BNNSActivationFunctionSoftShrink
An activation function that returns zero when the absolute input is less than alpha, otherwise it returns its input minus alpha.
Declaration
var BNNSActivationFunctionSoftShrink: BNNSActivationFunction { get }Discussion
This constant defines an activation function that returns values using the following operation:
abs(x) < abs(alpha)
0 if abs(x) < abs(alpha)
else
x-copysign(alpha, x)The following illustrates the output that the activation function generates from inputs in the range -10...10 and an alpha of 5:
[Image]
See Also
Raw Values
init(_:)init(rawValue:)rawValueBNNSActivationFunctionAbsBNNSActivationFunctionCELUBNNSActivationFunctionClampedLeakyRectifiedLinearBNNSActivationFunctionELUBNNSActivationFunctionErfBNNSActivationFunctionGELUBNNSActivationFunctionGELUApproximationBNNSActivationFunctionGELUApproximation2BNNSActivationFunctionGELUApproximationSigmoidBNNSActivationFunctionGumbelBNNSActivationFunctionGumbelMaxBNNSActivationFunctionHardShrink