Module ad

Module ad 

Source
Expand description

Tropical automatic differentiation via argmax routing.

Tropical operations (max/min-based) are not smooth, so standard AD does not apply. Instead, this module uses a subgradient-style route-through-winner policy: the forward pass records which input element won each tropical addition, and reverse/forward rules route derivatives through that winner.

§Architecture

Traits§

TropicalScalar
Trait for extracting the inner float type from a tropical scalar wrapper.

Functions§

extract_inner
Extract the inner real values from a tropical tensor.
promote_to_tropical
Promote a standard-real tensor to a tropical scalar tensor.
tropical_einsum_frule
Forward-mode rule (frule) for tropical einsum.
tropical_einsum_rrule
Reverse-mode rule (rrule) for tropical einsum.