tenferro_ext_tropical/ad/
mod.rs

1//! Tropical automatic differentiation via argmax routing.
2//!
3//! Tropical operations (max/min-based) are not smooth, so standard AD does not
4//! apply. Instead, this module uses a subgradient-style route-through-winner
5//! policy: the forward pass records which input element won each tropical
6//! addition, and reverse/forward rules route derivatives through that winner.
7//!
8//! # Architecture
9//!
10//! - [`tropical_einsum_rrule`]: standalone reverse-mode rule
11//! - [`tropical_einsum_frule`]: standalone forward-mode rule
12//! - [`promote_to_tropical`] / [`extract_inner`]: conversions between standard
13//!   and tropical scalar tensors
14
15mod backward;
16mod common;
17mod convert;
18mod forward;
19mod rules;
20mod scalar;
21
22pub use convert::{extract_inner, promote_to_tropical};
23pub use rules::{tropical_einsum_frule, tropical_einsum_rrule};
24pub use scalar::TropicalScalar;
25
26#[cfg(test)]
27mod tests;