GitHub
deepbox/nn

Activation Layers

Layer-form activations spanning classic, modern, and gating-oriented nonlinearities.
Nonlinearities

ELU

Applies the Exponential Linear Unit (ELU) activation.

GELU

Applies the Gaussian Error Linear Unit (GELU) activation.

GLU

GLU (Gated Linear Unit) activation.

Hardsigmoid

Hardsigmoid activation — piecewise linear approximation of sigmoid.

Hardswish

Hardswish activation — piecewise linear approximation of swish.

Hardtanh

Applies the HardTanh activation function.

LeakyReLU

Applies the Leaky Rectified Linear Unit (Leaky ReLU) activation.

LogSoftmax

Applies the Log Softmax activation function.

Mish

Applies the Mish activation function.

PReLU

PReLU (Parametric ReLU) activation with learnable slope parameter.

ReLU

Applies the Rectified Linear Unit (ReLU) activation function element-wise.

SELU

SELU (Scaled Exponential Linear Unit) activation for self-normalizing networks.

Sigmoid

Applies the Sigmoid activation function element-wise.

SiLU

SiLU (Sigmoid Linear Unit) activation — alias for Swish.

Softmax

Applies the Softmax activation function.

Softmax2d

Applies the Softmax2d activation function over spatial dimensions.

Softmin

Applies the Softmin activation function.

Softplus

Applies the Softplus activation function.

Softsign

Softsign activation function.

Swish

Applies the Swish activation function (also known as SiLU).

Tanh

Applies the Hyperbolic Tangent (Tanh) activation function element-wise.

Tanhshrink

Applies the Tanhshrink activation function element-wise.

nn-activations.ts
import { GELU, GLU, Mish, ReLU, Softmax, Swish } from "deepbox/nn";console.log(new ReLU(), new GELU(), new Swish(), new Mish(), new Softmax(), new GLU());