analogvnn.nn.activation.BinaryStep
#
Module Contents#
Classes#
Implements the binary step activation function. |
- class analogvnn.nn.activation.BinaryStep.BinaryStep[source]#
Bases:
analogvnn.nn.activation.Activation.Activation
Implements the binary step activation function.
- static forward(x: torch.Tensor) torch.Tensor [source]#
Forward pass of the binary step activation function.
- Parameters:
x (Tensor) – the input tensor.
- Returns:
the output tensor.
- Return type:
Tensor
- backward(grad_output: Optional[torch.Tensor]) Optional[torch.Tensor] [source]#
Backward pass of the binary step activation function.
- Parameters:
grad_output (Optional[Tensor]) – the gradient of the output tensor.
- Returns:
the gradient of the input tensor.
- Return type:
Optional[Tensor]