xnn.hybrid.models.spookynet.smooth_switch#

xnn.hybrid.models.spookynet.smooth_switch(r, r_on, r_off)[source]#

Switch from 1 (r <= r_on) to 0 (r >= r_off), smooth to every order (eq 25).

sigma(1 - x) / (sigma(1 - x) + sigma(x)) with x = (r - r_on) / (r_off - r_on) and sigma(x) = exp(-1 / x) for x > 0 (0 else).

Parameters:
Return type:

Tensor