HSigmoid¶
- class mmcv.cnn.HSigmoid(bias: float = 3.0, divisor: float = 6.0, min_value: float = 0.0, max_value: float = 1.0)[source]¶
Hard Sigmoid Module. Apply the hard sigmoid function: Hsigmoid(x) = min(max((x + bias) / divisor, min_value), max_value) Default: Hsigmoid(x) = min(max((x + 3) / 6, 0), 1)
Note
In MMCV v1.4.4, we modified the default value of args to align with PyTorch official.
- Parameters
- Returns
The output tensor.
- Return type
Tensor
- forward(x: torch.Tensor) → torch.Tensor[source]¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.