Skip to main content
Back to top
Ctrl
+
K
Install
Build and Install
Usage
Quick Start Guide
Unified Memory
Using Streams
Examples
Linear Regression
Multi-Layer Perceptron
LLM inference
Python API Reference
Array
mlx.core.array
mlx.core.array.astype
mlx.core.array.item
mlx.core.array.tolist
mlx.core.array.dtype
mlx.core.array.ndim
mlx.core.array.shape
mlx.core.array.size
mlx.core.Dtype
mlx.core.array.abs
mlx.core.array.all
mlx.core.array.any
mlx.core.array.argmax
mlx.core.array.argmin
mlx.core.array.cos
mlx.core.array.dtype
mlx.core.array.exp
mlx.core.array.log
mlx.core.array.log1p
mlx.core.array.logsumexp
mlx.core.array.max
mlx.core.array.mean
mlx.core.array.min
mlx.core.array.prod
mlx.core.array.reciprocal
mlx.core.array.reshape
mlx.core.array.rsqrt
mlx.core.array.sin
mlx.core.array.split
mlx.core.array.sqrt
mlx.core.array.square
mlx.core.array.sum
mlx.core.array.transpose
mlx.core.array.T
mlx.core.array.var
Devices and Streams
mlx.core.Device
mlx.core.default_device
mlx.core.set_default_device
mlx.core.Stream
mlx.core.default_stream
mlx.core.new_stream
mlx.core.set_default_stream
Operations
mlx.core.abs
mlx.core.add
mlx.core.all
mlx.core.allclose
mlx.core.any
mlx.core.arange
mlx.core.arccos
mlx.core.arccosh
mlx.core.arcsin
mlx.core.arcsinh
mlx.core.arctan
mlx.core.arctanh
mlx.core.argmax
mlx.core.argmin
mlx.core.argpartition
mlx.core.argsort
mlx.core.array_equal
mlx.core.broadcast_to
mlx.core.ceil
mlx.core.concatenate
mlx.core.convolve
mlx.core.conv1d
mlx.core.conv2d
mlx.core.cos
mlx.core.cosh
mlx.core.divide
mlx.core.equal
mlx.core.erf
mlx.core.erfinv
mlx.core.exp
mlx.core.expand_dims
mlx.core.eye
mlx.core.floor
mlx.core.flatten
mlx.core.full
mlx.core.greater
mlx.core.greater_equal
mlx.core.identity
mlx.core.less
mlx.core.less_equal
mlx.core.load
mlx.core.log
mlx.core.log2
mlx.core.log10
mlx.core.log1p
mlx.core.logaddexp
mlx.core.logical_not
mlx.core.logsumexp
mlx.core.matmul
mlx.core.max
mlx.core.maximum
mlx.core.mean
mlx.core.min
mlx.core.minimum
mlx.core.moveaxis
mlx.core.multiply
mlx.core.negative
mlx.core.ones
mlx.core.ones_like
mlx.core.partition
mlx.core.pad
mlx.core.prod
mlx.core.reciprocal
mlx.core.reshape
mlx.core.rsqrt
mlx.core.save
mlx.core.savez
mlx.core.savez_compressed
mlx.core.sigmoid
mlx.core.sign
mlx.core.sin
mlx.core.sinh
mlx.core.softmax
mlx.core.sort
mlx.core.split
mlx.core.sqrt
mlx.core.square
mlx.core.squeeze
mlx.core.stack
mlx.core.stop_gradient
mlx.core.subtract
mlx.core.sum
mlx.core.swapaxes
mlx.core.take
mlx.core.take_along_axis
mlx.core.tan
mlx.core.tanh
mlx.core.transpose
mlx.core.tri
mlx.core.tril
mlx.core.triu
mlx.core.var
mlx.core.where
mlx.core.zeros
mlx.core.zeros_like
Random
mlx.core.random.seed
mlx.core.random.key
mlx.core.random.split
mlx.core.random.bernoulli
mlx.core.random.categorical
mlx.core.random.gumbel
mlx.core.random.normal
mlx.core.random.randint
mlx.core.random.uniform
mlx.core.random.truncated_normal
Transforms
mlx.core.eval
mlx.core.grad
mlx.core.value_and_grad
mlx.core.jvp
mlx.core.vjp
mlx.core.vmap
mlx.core.simplify
FFT
mlx.core.fft.fft
mlx.core.fft.ifft
mlx.core.fft.fft2
mlx.core.fft.ifft2
mlx.core.fft.fftn
mlx.core.fft.ifftn
mlx.core.fft.rfft
mlx.core.fft.irfft
mlx.core.fft.rfft2
mlx.core.fft.irfft2
mlx.core.fft.rfftn
mlx.core.fft.irfftn
Neural Networks
mlx.nn.value_and_grad
mlx.nn.Module
Layers
mlx.nn.Embedding
mlx.nn.ReLU
mlx.nn.PReLU
mlx.nn.GELU
mlx.nn.SiLU
mlx.nn.Step
mlx.nn.SELU
mlx.nn.Mish
mlx.nn.Linear
mlx.nn.Conv1d
mlx.nn.Conv2d
mlx.nn.LayerNorm
mlx.nn.RMSNorm
mlx.nn.GroupNorm
mlx.nn.RoPE
mlx.nn.MultiHeadAttention
mlx.nn.Sequential
Functions
mlx.nn.gelu
mlx.nn.gelu_approx
mlx.nn.gelu_fast_approx
mlx.nn.relu
mlx.nn.prelu
mlx.nn.silu
mlx.nn.step
mlx.nn.selu
mlx.nn.mish
Loss Functions
mlx.nn.losses.cross_entropy
mlx.nn.losses.binary_cross_entropy
mlx.nn.losses.l1_loss
mlx.nn.losses.mse_loss
mlx.nn.losses.nll_loss
mlx.nn.losses.kl_div_loss
Optimizers
mlx.optimizers.OptimizerState
mlx.optimizers.Optimizer
mlx.optimizers.SGD
mlx.optimizers.RMSprop
mlx.optimizers.Adagrad
mlx.optimizers.AdaDelta
mlx.optimizers.Adam
mlx.optimizers.AdamW
mlx.optimizers.Adamax
Tree Utils
mlx.utils.tree_flatten
mlx.utils.tree_unflatten
mlx.utils.tree_map
C++ API Reference
Operations
Further Reading
Developer Documentation
.rst
.pdf
mlx.nn.PReLU
mlx.nn.PReLU
#
class
mlx.nn.
PReLU
(
num_parameters
=
1
,
init
=
0.25
)
#