ncdl.nn.ReLU6

class ncdl.nn.ReLU6(*args: Any, **kwargs: Any)

Applies the element-wise function:

\[\text{ReLU6}(x) = \min(\max(0,x), 6)\]
Parameters:

inplace – can optionally do the operation in-place. Default: False

Shape:
  • Input: \((*)\), where \(*\) means any number of dimensions.

  • Output: \((*)\), same shape as the input.

scripts/activation_images/ReLU6.png

Examples:

>>> m = nn.ReLU6()
>>> input = torch.randn(2)
>>> output = m(input)
__init__(inplace: bool = False)

Methods

__init__([inplace])

extra_repr()

forward(input)

Attributes

min_val

max_val

inplace