peal.global_utils.LeakySoftplus¶
- class peal.global_utils.LeakySoftplus[source]¶
Bases:
ModuleSmooth, everywhere non-zero gradient replacement for ReLU.
Computes
0.5 * (LeakyReLU(x, 0.1) + Softplus(x, beta=10)). Swapping the ReLUs of a predictor for this activation (seereplace_relu_with_leakysoftplus()) keeps the function close to the original one while removing the flat region that stalls the gradient-based counterfactual search.Methods
Return the mean of the leaky ReLU and the softplus of
x.