Tanhshrink#
- class brainpy.dnn.Tanhshrink(name=None, mode=None)[source]#
Applies the element-wise function:
\[\text{Tanhshrink}(x) = x - \tanh(x)\]- Shape:
Input: \((*)\), where \(*\) means any number of dimensions.
Output: \((*)\), same shape as the input.
Examples:
>>> import brainpy as bp >>> import brainpy.math as bm >>> m = bp.dnn.Tanhshrink() >>> input = bm.random.randn(2) >>> output = m(input)