Docs / jax4j-core / com.nablatensor.jax4j.ops
final class
Smooth
Smoothed indicators: differentiable stand-ins for the discontinuous STEP / GT / 1{a<x<b} that path-dependent expressions need for thresholds and interval membership.
Each takes a width in the same units as its argument. The functions are built entirely from the engine's primitive ops, so their adjoint is the exact derivative of the smoothed form (no special-cased reverse rule) and they run unchanged on every backend. As width -> 0 the smoothed value converges to the discontinuous limit; its derivative concentrates into a spike, representing the derivative of the smooth approximation.
Rule of thumb: width a fraction of a percent of the monitored quantity's scale (e.g. 0.01 * scale). Too small re-introduces the variance a discontinuity brings; too large biases the value.
Methods
Logistic step: ~1 for x >> 0, ~0 for x << 0, 0.5 at 0.
Smoothed 1{a > b}.
Smoothed 1{a > level}.
Smoothed 1{a < level}.
Smoothed 1{a < b}.
Smoothed band indicator 1{lo < x < hi}.
Numerically stable softplus: a smoothed max(x, 0). width -> 0 recovers the hockey-stick; useful for a smoothed option expression when the whole function must stay differentiable.