mlx.nn.hardswish

Contents

mlx.nn.hardswish#

class hardswish(x)#

Applies the hardswish function, element-wise.

\[\text{Hardswish}(x) = x * \min(\max(x + 3, 0), 6) / 6\]