public class ReLU<T extends AbstractFloat = Float> extends Layer<T>
Element-wise rectified linear activation for a batch of any sample shape. The derivative at zero is defined as zero. NaN inputs remain NaN.
output = ReLU<Float>().forward(inputs)
| Modifier and Type | Member | Description |
|---|---|---|
| public override readonly property | displayNamedisplayName as String |
Summary label. |
| public override readonly property | parameterCountparameterCount as ULong |
ReLU has no trainable parameters. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | backward | Propagates an upstream derivative through the activation. |
| public | build | Validates the width; this activation has no parameters to initialize. |
| public override | buildShape | Validates arbitrary positive sample dimensions. |
| public override | differentiatedifferentiate(inputs as NDArray<T>, upstream as NDArray<T>) as LayerGradients<T> |
Computes input derivatives; there are no parameter derivatives. |
| public override | forward | Applies max(0, x) to each batch element without retaining inputs. |
| public override | parameter | Rejects every parameter index because ReLU has no parameters. |