Expand description
Neural network support for MLX
All modules provide a new()
function that take mandatory parameters and other methods
to set optional parameters.
Structs§
- Attention with Linear Biases
- Input for the
Alibi
module. - Builder for
AlibiInput
. - Applies 1-dimensional average pooling.
- Applies 2-dimensional average pooling.
- Applies batch normalization [1] on the inputs.
- Builder for
BatchNorm
. - Applies a bilinear transformation to the inputs.
- Builder for
Bilinear
module - Applies the Continuously Differentiable Exponential Linear Unit.
- Builder for
Celu
. - Applies a 1-dimensional convolution over the multi-channel input sequence.
- Builder for the
Conv1d
module. - Applies a 2-dimensional convolution over the multi-channel input image.
- Builder for the
Conv2d
module. - Applies a 3-dimensional convolution over the multi-channel input image.
- Builder for the
Conv3d
module. - Applies a 1-dimensional convolution over the multi-channel input sequence.
- Builder for the
ConvTranspose1d
module. - Applies a 2-dimensional convolution over the multi-channel input image.
- Builder for the
ConvTranspose2d
module. - Applies a 3-dimensional convolution over the multi-channel input image.
- Builder for the
ConvTranspose3d
module. - Randomly zero a portion of the elements during training.
- Apply 2D channel-wise dropout during training.
- Builder for
Dropout2d
. - Apply 3D channel-wise dropout during training.
- Builder for
Dropout3d
. - Builder for
Dropout
. - Implements a simple lookup table that maps each input integer to a high-dimensional vector.
- Applies the Gaussian Error Linear Units function.
- Builder for
Gelu
. - Applies the gated linear unit function.
- Builder for
Glu
. - Applies Group Normalization [1] on the inputs.
- Builder for
GroupNorm
. - A gated recurrent unit (GRU) RNN layer.
- Builder for the
Gru
module. - Applies the hardswish function, element-wise
- Applies instance normalization [1] on the inputs.
- Builder for
InstanceNorm
. - Applies layer normalization [1] on the inputs.
- Builder for
LayerNorm
. - Applies the Leaky Rectified Linear Unit.
- Builder for
LeakyRelu
. - Applies an affine transformation to the input.
- Builder for
Linear
module - Applies the Log Sigmoid function.
- Applies the Log Softmax function.
- Builder for
LogSoftmax
. - A long short-term memory (LSTM) RNN layer.
- Builder for the
Lstm
module. - Input for the LSTM module.
- Builder for
LstmInput
. - Applies 1-dimensional max pooling.
- Applies 2-dimensional max pooling.
- Applies the Mish function, element-wise.
- Implements the scaled dot product attention with multiple heads.
- Builder for the
MultiHeadAttention
module - Input to the
MultiHeadAttention
module - Builder for
MultiHeadAttentionInput
. - Abstract pooling layer.
- Applies the element-wise parametric ReLU.
- The builder for the Prelu module.
- The same as
Embedding
but with a quantized weight matrix. - Builder for
QuantizedEmbedding
- Applies an affine transformation to the input using a quantized weight matrix.
- Builder for
QuantizedLinear
- Applies the Rectified Linear Unit.
- Applies the Rectified Linear Unit 6.
- Applies Root Mean Square normalization [1] to the inputs.
- Builder for
RmsNorm
. - An Elman recurrent layer.
- Builder for the
Rnn
module. - Input for the RNN module.
- Builder for
RnnInput
. - Input for the
RotaryPositionalEncoding
module. - Builder for
RopeInput
. - Implements the rotary positional encoding.
- Builder for
RotaryPositionalEncoding
. - Applies the Scaled Exponential Linear Unit.
- A sequential layer.
- Applies the element-wise logistic sigmoid.
- Applies the Sigmoid Linear Unit. Also known as Swish.
- Implements sinusoidal positional encoding.
- Builder for
SinusoidalPositionalEncoding
. - Applies the Softmax function.
- Builder for
Softmax
. - Applies the Softplus function.
- Applies the Softsign function.
- Applies the Step Activation Function.
- Builder for
Step
. - Applies the hyperbolic tangent function
- Implements a standard Transformer model.
- Builder for the
Transformer
module - Input to the
Transformer
module - Upsample the input signal spatially
Enums§
- Variants of Gaussian Error Linear Units function.
- Upsample mode
Traits§
- A marker trait for activation functions used in transformers.
- Helper trait for
value_and_grad
- Marker trait for pooling operations.
- Marker trait for items that can be used in a
Sequential
module.
Functions§
- Builds a new
QuantizedLinear
- Applies the Continuously Differentiable Exponential Linear Unit.
- Applies the Exponential Linear Unit.
- Applies the Gaussian Error Linear Units function.
- An approximation to Gaussian Error Linear Unit.
- A fast approximation to Gaussian Error Linear Unit.
- Applies the gated linear unit function.
- Applies the hardswish function, element-wise.
- Applies the Leaky Rectified Linear Unit.
- Applies the Log Sigmoid function.
- Applies the Log Softmax function.
- Applies the Mish function, element-wise.
- Applies the element-wise parametric ReLU.
- Quantize a module.
- Applies the Rectified Linear Unit.
- Applies the Rectified Linear Unit 6.
- Applies the Scaled Exponential Linear Unit.
- Applies the element-wise sigmoid logistic sigmoid.
- Applies the Sigmoid Linear Unit. Also known as Swish.
- Applies the Exponential Linear Unit.
- Applies the Softsign function.
- Applies the Step Activation Function.
- Transform the passed function
f(model, args)
to a function that computes the gradients off
with regard to the model’s trainable parameters and also its value.
Type Aliases§
- Type alias for the input of the GRU module.
- Type alias for the builder of the input of the GRU module.
- Type alias for the non-linearity function.
- Type alias for
RotaryPositionalEncoding
. - Type alias for
RotaryPositionalEncodingBuilder
. - Type alias for
SinusoidalPositionalEncoding
. - Type alias for
SinusoidalPositionalEncodingBuilder
.