Skip to main content
Ctrl+K

flax.linen.activation.hard_swish#

flax.linen.activation.hard_swish(x)#

Hard SiLU (swish) activation function

Computes the element-wise function

\[\mathrm{hard\_silu}(x) = x \cdot \mathrm{hard\_sigmoid}(x)\]

Both hard_silu() and hard_swish() are aliases for the same function.

Parameters:

x (Union[Array, ndarray, bool_, number, bool, int, float, complex]) – input array

Return type:

Array

Returns:

An array.

See also

hard_sigmoid()