From d03b91923e41807bd97ebaf69ff53619edd6ca66 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Wed, 3 Jan 2024 20:14:05 -0800 Subject: [PATCH] docs update --- docs/build/html/.buildinfo | 2 +- docs/build/html/_sources/dev/extensions.rst | 32 +- docs/build/html/_sources/index.rst | 3 +- docs/build/html/_sources/indexing.rst | 12 + .../python/_autosummary/mlx.core.array.rst | 2 + .../_autosummary/mlx.core.linalg.norm.rst | 6 + .../python/_autosummary/mlx.core.repeat.rst | 6 + .../mlx.core.save_safetensors.rst | 6 + .../_autosummary/mlx.core.tensordot.rst | 6 + docs/build/html/_sources/python/linalg.rst | 11 + docs/build/html/_sources/python/nn.rst | 7 +- .../python/nn/_autosummary/mlx.nn.ALiBi.rst | 8 + .../nn/_autosummary/mlx.nn.BatchNorm.rst | 8 + .../python/nn/_autosummary/mlx.nn.Dropout.rst | 8 + .../nn/_autosummary/mlx.nn.Dropout2d.rst | 8 + .../nn/_autosummary/mlx.nn.Dropout3d.rst | 8 + .../nn/_autosummary/mlx.nn.InstanceNorm.rst | 8 + .../nn/_autosummary/mlx.nn.Module.apply.rst | 6 + .../mlx.nn.Module.apply_to_modules.rst | 6 + .../_autosummary/mlx.nn.Module.children.rst | 6 + .../nn/_autosummary/mlx.nn.Module.eval.rst | 6 + .../mlx.nn.Module.filter_and_map.rst | 6 + .../nn/_autosummary/mlx.nn.Module.freeze.rst | 6 + .../mlx.nn.Module.leaf_modules.rst | 6 + .../mlx.nn.Module.load_weights.rst | 6 + .../nn/_autosummary/mlx.nn.Module.modules.rst | 6 + .../mlx.nn.Module.named_modules.rst | 6 + .../_autosummary/mlx.nn.Module.parameters.rst | 6 + .../mlx.nn.Module.save_weights.rst | 6 + .../nn/_autosummary/mlx.nn.Module.train.rst | 6 + .../mlx.nn.Module.trainable_parameters.rst | 6 + .../_autosummary/mlx.nn.Module.training.rst | 6 + .../_autosummary/mlx.nn.Module.unfreeze.rst | 6 + .../nn/_autosummary/mlx.nn.Module.update.rst | 6 + .../mlx.nn.Module.update_modules.rst | 6 + .../mlx.nn.SinusoidalPositionalEncoding.rst | 8 + .../nn/_autosummary/mlx.nn.Transformer.rst | 8 + .../mlx.nn.losses.hinge_loss.rst | 8 + .../mlx.nn.losses.huber_loss.rst | 8 + .../mlx.nn.losses.log_cosh_loss.rst | 8 + docs/build/html/_sources/python/nn/layers.rst | 16 +- docs/build/html/_sources/python/nn/losses.rst | 5 +- docs/build/html/_sources/python/nn/module.rst | 36 + docs/build/html/_sources/python/ops.rst | 3 + .../html/_static/documentation_options.js | 2 +- docs/build/html/cpp/ops.html | 66 +- docs/build/html/dev/extensions.html | 100 +- .../html/examples/linear_regression.html | 66 +- docs/build/html/examples/llama-inference.html | 66 +- docs/build/html/examples/mlp.html | 70 +- docs/build/html/genindex.html | 173 +++- docs/build/html/index.html | 69 +- docs/build/html/indexing.html | 703 ++++++++++++++ docs/build/html/install.html | 66 +- docs/build/html/objects.inv | Bin 5533 -> 6429 bytes .../python/_autosummary/mlx.core.Device.html | 66 +- .../python/_autosummary/mlx.core.Dtype.html | 66 +- .../python/_autosummary/mlx.core.Stream.html | 66 +- .../python/_autosummary/mlx.core.abs.html | 66 +- .../python/_autosummary/mlx.core.add.html | 66 +- .../python/_autosummary/mlx.core.all.html | 66 +- .../_autosummary/mlx.core.allclose.html | 66 +- .../python/_autosummary/mlx.core.any.html | 66 +- .../python/_autosummary/mlx.core.arange.html | 66 +- .../python/_autosummary/mlx.core.arccos.html | 66 +- .../python/_autosummary/mlx.core.arccosh.html | 66 +- .../python/_autosummary/mlx.core.arcsin.html | 66 +- .../python/_autosummary/mlx.core.arcsinh.html | 66 +- .../python/_autosummary/mlx.core.arctan.html | 66 +- .../python/_autosummary/mlx.core.arctanh.html | 66 +- .../python/_autosummary/mlx.core.argmax.html | 68 +- .../python/_autosummary/mlx.core.argmin.html | 66 +- .../_autosummary/mlx.core.argpartition.html | 68 +- .../python/_autosummary/mlx.core.argsort.html | 66 +- .../python/_autosummary/mlx.core.array.T.html | 66 +- .../_autosummary/mlx.core.array.abs.html | 66 +- .../_autosummary/mlx.core.array.all.html | 66 +- .../_autosummary/mlx.core.array.any.html | 66 +- .../_autosummary/mlx.core.array.argmax.html | 66 +- .../_autosummary/mlx.core.array.argmin.html | 66 +- .../_autosummary/mlx.core.array.astype.html | 66 +- .../_autosummary/mlx.core.array.cos.html | 66 +- .../_autosummary/mlx.core.array.dtype.html | 66 +- .../_autosummary/mlx.core.array.exp.html | 66 +- .../python/_autosummary/mlx.core.array.html | 74 +- .../_autosummary/mlx.core.array.item.html | 66 +- .../_autosummary/mlx.core.array.log.html | 66 +- .../_autosummary/mlx.core.array.log1p.html | 66 +- .../mlx.core.array.logsumexp.html | 66 +- .../_autosummary/mlx.core.array.max.html | 66 +- .../_autosummary/mlx.core.array.mean.html | 66 +- .../_autosummary/mlx.core.array.min.html | 66 +- .../_autosummary/mlx.core.array.ndim.html | 66 +- .../_autosummary/mlx.core.array.prod.html | 66 +- .../mlx.core.array.reciprocal.html | 66 +- .../_autosummary/mlx.core.array.reshape.html | 66 +- .../_autosummary/mlx.core.array.round.html | 66 +- .../_autosummary/mlx.core.array.rsqrt.html | 66 +- .../_autosummary/mlx.core.array.shape.html | 66 +- .../_autosummary/mlx.core.array.sin.html | 66 +- .../_autosummary/mlx.core.array.size.html | 68 +- .../_autosummary/mlx.core.array.split.html | 66 +- .../_autosummary/mlx.core.array.sqrt.html | 66 +- .../_autosummary/mlx.core.array.square.html | 66 +- .../_autosummary/mlx.core.array.sum.html | 66 +- .../_autosummary/mlx.core.array.tolist.html | 68 +- .../mlx.core.array.transpose.html | 66 +- .../_autosummary/mlx.core.array.var.html | 66 +- .../_autosummary/mlx.core.array_equal.html | 66 +- .../_autosummary/mlx.core.broadcast_to.html | 66 +- .../python/_autosummary/mlx.core.ceil.html | 66 +- .../python/_autosummary/mlx.core.clip.html | 66 +- .../_autosummary/mlx.core.concatenate.html | 66 +- .../python/_autosummary/mlx.core.conv1d.html | 66 +- .../python/_autosummary/mlx.core.conv2d.html | 66 +- .../_autosummary/mlx.core.convolve.html | 66 +- .../python/_autosummary/mlx.core.cos.html | 66 +- .../python/_autosummary/mlx.core.cosh.html | 66 +- .../_autosummary/mlx.core.default_device.html | 66 +- .../_autosummary/mlx.core.default_stream.html | 66 +- .../_autosummary/mlx.core.dequantize.html | 70 +- .../python/_autosummary/mlx.core.divide.html | 66 +- .../python/_autosummary/mlx.core.equal.html | 66 +- .../python/_autosummary/mlx.core.erf.html | 66 +- .../python/_autosummary/mlx.core.erfinv.html | 66 +- .../python/_autosummary/mlx.core.eval.html | 66 +- .../python/_autosummary/mlx.core.exp.html | 66 +- .../_autosummary/mlx.core.expand_dims.html | 66 +- .../python/_autosummary/mlx.core.eye.html | 66 +- .../python/_autosummary/mlx.core.fft.fft.html | 66 +- .../_autosummary/mlx.core.fft.fft2.html | 66 +- .../_autosummary/mlx.core.fft.fftn.html | 66 +- .../_autosummary/mlx.core.fft.ifft.html | 66 +- .../_autosummary/mlx.core.fft.ifft2.html | 66 +- .../_autosummary/mlx.core.fft.ifftn.html | 66 +- .../_autosummary/mlx.core.fft.irfft.html | 66 +- .../_autosummary/mlx.core.fft.irfft2.html | 66 +- .../_autosummary/mlx.core.fft.irfftn.html | 72 +- .../_autosummary/mlx.core.fft.rfft.html | 66 +- .../_autosummary/mlx.core.fft.rfft2.html | 66 +- .../_autosummary/mlx.core.fft.rfftn.html | 66 +- .../python/_autosummary/mlx.core.flatten.html | 66 +- .../python/_autosummary/mlx.core.floor.html | 66 +- .../_autosummary/mlx.core.floor_divide.html | 66 +- .../python/_autosummary/mlx.core.full.html | 66 +- .../python/_autosummary/mlx.core.grad.html | 66 +- .../python/_autosummary/mlx.core.greater.html | 66 +- .../_autosummary/mlx.core.greater_equal.html | 66 +- .../_autosummary/mlx.core.identity.html | 66 +- .../python/_autosummary/mlx.core.jvp.html | 66 +- .../python/_autosummary/mlx.core.less.html | 66 +- .../_autosummary/mlx.core.less_equal.html | 66 +- .../_autosummary/mlx.core.linalg.norm.html | 883 ++++++++++++++++++ .../_autosummary/mlx.core.linspace.html | 66 +- .../python/_autosummary/mlx.core.load.html | 80 +- .../python/_autosummary/mlx.core.log.html | 66 +- .../python/_autosummary/mlx.core.log10.html | 66 +- .../python/_autosummary/mlx.core.log1p.html | 66 +- .../python/_autosummary/mlx.core.log2.html | 66 +- .../_autosummary/mlx.core.logaddexp.html | 66 +- .../_autosummary/mlx.core.logical_not.html | 66 +- .../_autosummary/mlx.core.logsumexp.html | 66 +- .../python/_autosummary/mlx.core.matmul.html | 66 +- .../python/_autosummary/mlx.core.max.html | 66 +- .../python/_autosummary/mlx.core.maximum.html | 66 +- .../python/_autosummary/mlx.core.mean.html | 66 +- .../python/_autosummary/mlx.core.min.html | 66 +- .../python/_autosummary/mlx.core.minimum.html | 66 +- .../_autosummary/mlx.core.moveaxis.html | 66 +- .../_autosummary/mlx.core.multiply.html | 66 +- .../_autosummary/mlx.core.negative.html | 66 +- .../_autosummary/mlx.core.new_stream.html | 66 +- .../python/_autosummary/mlx.core.ones.html | 66 +- .../_autosummary/mlx.core.ones_like.html | 66 +- .../python/_autosummary/mlx.core.pad.html | 66 +- .../_autosummary/mlx.core.partition.html | 66 +- .../python/_autosummary/mlx.core.prod.html | 66 +- .../_autosummary/mlx.core.quantize.html | 70 +- .../mlx.core.quantized_matmul.html | 75 +- .../mlx.core.random.bernoulli.html | 66 +- .../mlx.core.random.categorical.html | 66 +- .../_autosummary/mlx.core.random.gumbel.html | 66 +- .../_autosummary/mlx.core.random.key.html | 66 +- .../_autosummary/mlx.core.random.normal.html | 66 +- .../_autosummary/mlx.core.random.randint.html | 66 +- .../_autosummary/mlx.core.random.seed.html | 66 +- .../_autosummary/mlx.core.random.split.html | 66 +- .../mlx.core.random.truncated_normal.html | 68 +- .../_autosummary/mlx.core.random.uniform.html | 66 +- .../_autosummary/mlx.core.reciprocal.html | 72 +- .../python/_autosummary/mlx.core.repeat.html | 746 +++++++++++++++ .../python/_autosummary/mlx.core.reshape.html | 72 +- .../python/_autosummary/mlx.core.round.html | 68 +- .../python/_autosummary/mlx.core.rsqrt.html | 66 +- .../python/_autosummary/mlx.core.save.html | 73 +- .../mlx.core.save_safetensors.html | 740 +++++++++++++++ .../python/_autosummary/mlx.core.savez.html | 66 +- .../mlx.core.savez_compressed.html | 72 +- .../mlx.core.set_default_device.html | 66 +- .../mlx.core.set_default_stream.html | 66 +- .../python/_autosummary/mlx.core.sigmoid.html | 72 +- .../python/_autosummary/mlx.core.sign.html | 66 +- .../_autosummary/mlx.core.simplify.html | 66 +- .../python/_autosummary/mlx.core.sin.html | 66 +- .../python/_autosummary/mlx.core.sinh.html | 66 +- .../python/_autosummary/mlx.core.softmax.html | 66 +- .../python/_autosummary/mlx.core.sort.html | 66 +- .../python/_autosummary/mlx.core.split.html | 66 +- .../python/_autosummary/mlx.core.sqrt.html | 66 +- .../python/_autosummary/mlx.core.square.html | 66 +- .../python/_autosummary/mlx.core.squeeze.html | 66 +- .../python/_autosummary/mlx.core.stack.html | 66 +- .../_autosummary/mlx.core.stop_gradient.html | 66 +- .../_autosummary/mlx.core.subtract.html | 66 +- .../python/_autosummary/mlx.core.sum.html | 66 +- .../_autosummary/mlx.core.swapaxes.html | 66 +- .../python/_autosummary/mlx.core.take.html | 68 +- .../mlx.core.take_along_axis.html | 66 +- .../python/_autosummary/mlx.core.tan.html | 66 +- .../python/_autosummary/mlx.core.tanh.html | 72 +- .../_autosummary/mlx.core.tensordot.html | 747 +++++++++++++++ .../_autosummary/mlx.core.transpose.html | 72 +- .../python/_autosummary/mlx.core.tri.html | 66 +- .../python/_autosummary/mlx.core.tril.html | 66 +- .../python/_autosummary/mlx.core.triu.html | 66 +- .../_autosummary/mlx.core.value_and_grad.html | 70 +- .../python/_autosummary/mlx.core.var.html | 66 +- .../python/_autosummary/mlx.core.vjp.html | 66 +- .../python/_autosummary/mlx.core.vmap.html | 66 +- .../python/_autosummary/mlx.core.where.html | 66 +- .../python/_autosummary/mlx.core.zeros.html | 66 +- .../_autosummary/mlx.core.zeros_like.html | 66 +- .../_autosummary/mlx.nn.value_and_grad.html | 76 +- .../_autosummary/mlx.optimizers.AdaDelta.html | 68 +- .../_autosummary/mlx.optimizers.Adagrad.html | 66 +- .../_autosummary/mlx.optimizers.Adam.html | 66 +- .../_autosummary/mlx.optimizers.AdamW.html | 66 +- .../_autosummary/mlx.optimizers.Adamax.html | 66 +- .../_autosummary/mlx.optimizers.Lion.html | 66 +- .../mlx.optimizers.Optimizer.html | 66 +- .../mlx.optimizers.OptimizerState.html | 66 +- .../_autosummary/mlx.optimizers.RMSprop.html | 66 +- .../_autosummary/mlx.optimizers.SGD.html | 66 +- .../_autosummary/mlx.utils.tree_flatten.html | 66 +- .../_autosummary/mlx.utils.tree_map.html | 66 +- .../mlx.utils.tree_unflatten.html | 66 +- docs/build/html/python/array.html | 68 +- docs/build/html/python/data_types.html | 66 +- .../html/python/devices_and_streams.html | 66 +- docs/build/html/python/fft.html | 66 +- docs/build/html/python/linalg.html | 729 +++++++++++++++ docs/build/html/python/nn.html | 141 ++- .../python/nn/_autosummary/mlx.nn.ALiBi.html | 727 ++++++++++++++ .../nn/_autosummary/mlx.nn.BatchNorm.html | 765 +++++++++++++++ .../python/nn/_autosummary/mlx.nn.Conv1d.html | 72 +- .../python/nn/_autosummary/mlx.nn.Conv2d.html | 72 +- .../nn/_autosummary/mlx.nn.Dropout.html | 737 +++++++++++++++ .../nn/_autosummary/mlx.nn.Dropout2d.html | 747 +++++++++++++++ .../nn/_autosummary/mlx.nn.Dropout3d.html | 744 +++++++++++++++ .../nn/_autosummary/mlx.nn.Embedding.html | 78 +- .../python/nn/_autosummary/mlx.nn.GELU.html | 66 +- .../nn/_autosummary/mlx.nn.GroupNorm.html | 72 +- .../nn/_autosummary/mlx.nn.InstanceNorm.html | 761 +++++++++++++++ .../nn/_autosummary/mlx.nn.LayerNorm.html | 72 +- .../python/nn/_autosummary/mlx.nn.Linear.html | 87 +- .../python/nn/_autosummary/mlx.nn.Mish.html | 72 +- .../nn/_autosummary/mlx.nn.Module.apply.html | 740 +++++++++++++++ .../mlx.nn.Module.apply_to_modules.html | 734 +++++++++++++++ .../_autosummary/mlx.nn.Module.children.html | 728 +++++++++++++++ .../nn/_autosummary/mlx.nn.Module.eval.html | 729 +++++++++++++++ .../mlx.nn.Module.filter_and_map.html | 747 +++++++++++++++ .../nn/_autosummary/mlx.nn.Module.freeze.html | 751 +++++++++++++++ .../mlx.nn.Module.leaf_modules.html | 728 +++++++++++++++ .../mlx.nn.Module.load_weights.html | 768 +++++++++++++++ .../_autosummary/mlx.nn.Module.modules.html | 733 +++++++++++++++ .../mlx.nn.Module.named_modules.html | 734 +++++++++++++++ .../mlx.nn.Module.parameters.html | 729 +++++++++++++++ .../mlx.nn.Module.save_weights.html | 728 +++++++++++++++ .../nn/_autosummary/mlx.nn.Module.train.html | 737 +++++++++++++++ .../mlx.nn.Module.trainable_parameters.html | 729 +++++++++++++++ .../_autosummary/mlx.nn.Module.training.html | 728 +++++++++++++++ .../_autosummary/mlx.nn.Module.unfreeze.html | 751 +++++++++++++++ .../nn/_autosummary/mlx.nn.Module.update.html | 741 +++++++++++++++ .../mlx.nn.Module.update_modules.html | 741 +++++++++++++++ .../mlx.nn.MultiHeadAttention.html | 118 ++- .../python/nn/_autosummary/mlx.nn.PReLU.html | 83 +- .../_autosummary/mlx.nn.QuantizedLinear.html | 78 +- .../nn/_autosummary/mlx.nn.RMSNorm.html | 66 +- .../python/nn/_autosummary/mlx.nn.ReLU.html | 72 +- .../python/nn/_autosummary/mlx.nn.RoPE.html | 90 +- .../python/nn/_autosummary/mlx.nn.SELU.html | 66 +- .../nn/_autosummary/mlx.nn.Sequential.html | 78 +- .../python/nn/_autosummary/mlx.nn.SiLU.html | 66 +- .../mlx.nn.SinusoidalPositionalEncoding.html | 747 +++++++++++++++ .../python/nn/_autosummary/mlx.nn.Step.html | 66 +- .../nn/_autosummary/mlx.nn.Transformer.html | 762 +++++++++++++++ .../_autosummary_functions/mlx.nn.gelu.html | 66 +- .../mlx.nn.gelu_approx.html | 66 +- .../mlx.nn.gelu_fast_approx.html | 66 +- .../mlx.nn.losses.binary_cross_entropy.html | 66 +- .../mlx.nn.losses.cross_entropy.html | 66 +- .../mlx.nn.losses.hinge_loss.html | 747 +++++++++++++++ .../mlx.nn.losses.huber_loss.html | 753 +++++++++++++++ .../mlx.nn.losses.kl_div_loss.html | 66 +- .../mlx.nn.losses.l1_loss.html | 66 +- .../mlx.nn.losses.log_cosh_loss.html | 752 +++++++++++++++ .../mlx.nn.losses.mse_loss.html | 66 +- .../mlx.nn.losses.nll_loss.html | 66 +- .../mlx.nn.losses.smooth_l1_loss.html | 66 +- .../mlx.nn.losses.triplet_loss.html | 72 +- .../_autosummary_functions/mlx.nn.mish.html | 66 +- .../_autosummary_functions/mlx.nn.prelu.html | 70 +- .../_autosummary_functions/mlx.nn.relu.html | 66 +- .../_autosummary_functions/mlx.nn.selu.html | 66 +- .../_autosummary_functions/mlx.nn.silu.html | 66 +- .../_autosummary_functions/mlx.nn.step.html | 66 +- docs/build/html/python/nn/functions.html | 74 +- docs/build/html/python/nn/layers.html | 130 ++- docs/build/html/python/nn/losses.html | 75 +- docs/build/html/python/nn/module.html | 831 ++++++++++++++++ docs/build/html/python/ops.html | 109 ++- docs/build/html/python/optimizers.html | 72 +- docs/build/html/python/random.html | 66 +- docs/build/html/python/transforms.html | 66 +- docs/build/html/python/tree_utils.html | 66 +- docs/build/html/quick_start.html | 66 +- docs/build/html/search.html | 66 +- docs/build/html/searchindex.js | 2 +- docs/build/html/unified_memory.html | 66 +- docs/build/html/using_streams.html | 66 +- 330 files changed, 40495 insertions(+), 3726 deletions(-) create mode 100644 docs/build/html/_sources/indexing.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.linalg.norm.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.repeat.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.save_safetensors.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.tensordot.rst create mode 100644 docs/build/html/_sources/python/linalg.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.children.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.eval.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.filter_and_map.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.freeze.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.leaf_modules.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.load_weights.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.modules.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.named_modules.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.parameters.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.save_weights.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.train.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.training.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.unfreeze.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update_modules.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst create mode 100644 docs/build/html/_sources/python/nn/module.rst create mode 100644 docs/build/html/indexing.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.linalg.norm.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.repeat.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.save_safetensors.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.tensordot.html create mode 100644 docs/build/html/python/linalg.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.ALiBi.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.BatchNorm.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Dropout.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Dropout2d.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Dropout3d.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.InstanceNorm.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.children.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.eval.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.filter_and_map.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.freeze.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.leaf_modules.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.load_weights.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.modules.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.named_modules.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.parameters.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.save_weights.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.train.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.training.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.unfreeze.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.update.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Module.update_modules.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.Transformer.html create mode 100644 docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.html create mode 100644 docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.html create mode 100644 docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.html create mode 100644 docs/build/html/python/nn/module.html diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index 0bdadc036..f0399f624 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 78e86a9caf7acb193f064f97ea2f4572 +config: 38bd5d82efdab9011af8239531f26d1f tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_sources/dev/extensions.rst b/docs/build/html/_sources/dev/extensions.rst index 9aae931a3..0a134e7f5 100644 --- a/docs/build/html/_sources/dev/extensions.rst +++ b/docs/build/html/_sources/dev/extensions.rst @@ -15,7 +15,7 @@ Introducing the Example ----------------------- Let's say that you would like an operation that takes in two arrays, -``x`` and ``y``, scales them both by some coefficents ``alpha`` and ``beta`` +``x`` and ``y``, scales them both by some coefficients ``alpha`` and ``beta`` respectively, and then adds them together to get the result ``z = alpha * x + beta * y``. Well, you can very easily do that by just writing out a function as follows: @@ -69,7 +69,7 @@ C++ API: .. code-block:: C++ /** - * Scale and sum two vectors elementwise + * Scale and sum two vectors element-wise * z = alpha * x + beta * y * * Follow numpy style broadcasting between x and y @@ -230,7 +230,7 @@ Let's re-implement our operation now in terms of our :class:`Axpby` primitive. This operation now handles the following: -#. Upcast inputs and resolve the the output data type. +#. Upcast inputs and resolve the output data type. #. Broadcast the inputs and resolve the output shape. #. Construct the primitive :class:`Axpby` using the given stream, ``alpha``, and ``beta``. #. Construct the output :class:`array` using the primitive and the inputs. @@ -284,14 +284,14 @@ pointwise. This is captured in the templated function :meth:`axpby_impl`. T alpha = static_cast(alpha_); T beta = static_cast(beta_); - // Do the elementwise operation for each output + // Do the element-wise operation for each output for (size_t out_idx = 0; out_idx < out.size(); out_idx++) { // Map linear indices to offsets in x and y auto x_offset = elem_to_loc(out_idx, x.shape(), x.strides()); auto y_offset = elem_to_loc(out_idx, y.shape(), y.strides()); // We allocate the output to be contiguous and regularly strided - // (defaults to row major) and hence it doesn't need additonal mapping + // (defaults to row major) and hence it doesn't need additional mapping out_ptr[out_idx] = alpha * x_ptr[x_offset] + beta * y_ptr[y_offset]; } } @@ -305,7 +305,7 @@ if we encounter an unexpected type. /** Fall back implementation for evaluation on CPU */ void Axpby::eval(const std::vector& inputs, array& out) { - // Check the inputs (registered in the op while contructing the out array) + // Check the inputs (registered in the op while constructing the out array) assert(inputs.size() == 2); auto& x = inputs[0]; auto& y = inputs[1]; @@ -485,7 +485,7 @@ each data type. instantiate_axpby(float32, float); instantiate_axpby(float16, half); - instantiate_axpby(bflot16, bfloat16_t); + instantiate_axpby(bfloat16, bfloat16_t); instantiate_axpby(complex64, complex64_t); This kernel will be compiled into a metal library ``mlx_ext.metallib`` as we @@ -537,7 +537,7 @@ below. compute_encoder->setComputePipelineState(kernel); // Kernel parameters are registered with buffer indices corresponding to - // those in the kernel decelaration at axpby.metal + // those in the kernel declaration at axpby.metal int ndim = out.ndim(); size_t nelem = out.size(); @@ -568,7 +568,7 @@ below. // Fix the 3D size of the launch grid (in terms of threads) MTL::Size grid_dims = MTL::Size(nelem, 1, 1); - // Launch the grid with the given number of threads divded among + // Launch the grid with the given number of threads divided among // the given threadgroups compute_encoder->dispatchThreads(grid_dims, group_dims); } @@ -581,7 +581,7 @@ to give us the active metal compute command encoder instead of building a new one and calling :meth:`compute_encoder->end_encoding` at the end. MLX keeps adding kernels (compute pipelines) to the active command encoder until some specified limit is hit or the compute encoder needs to be flushed -for synchronization. MLX also handles enqueuing and commiting the associated +for synchronization. MLX also handles enqueuing and committing the associated command buffers as needed. We suggest taking a deeper dive into :class:`metal::Device` if you would like to study this routine further. @@ -601,8 +601,8 @@ us the following :meth:`Axpby::jvp` and :meth:`Axpby::vjp` implementations. const std::vector& tangents, const std::vector& argnums) { // Forward mode diff that pushes along the tangents - // The jvp transform on the the primitive can built with ops - // that are scheduled on the same stream as the primtive + // The jvp transform on the primitive can built with ops + // that are scheduled on the same stream as the primitive // If argnums = {0}, we only push along x in which case the // jvp is just the tangent scaled by alpha @@ -642,7 +642,7 @@ own :class:`Primitive`. .. code-block:: C++ - /** Vectorize primitve along given axis */ + /** Vectorize primitive along given axis */ std::pair Axpby::vmap( const std::vector& inputs, const std::vector& axes) { @@ -666,7 +666,7 @@ Let's look at the overall directory structure first. | └── setup.py * ``extensions/axpby/`` defines the C++ extension library -* ``extensions/mlx_sample_extensions`` sets out the strucutre for the +* ``extensions/mlx_sample_extensions`` sets out the structure for the associated python package * ``extensions/bindings.cpp`` provides python bindings for our operation * ``extensions/CMakeLists.txt`` holds CMake rules to build the library and @@ -697,7 +697,7 @@ are already provided, adding our :meth:`axpby` becomes very simple! py::kw_only(), "stream"_a = py::none(), R"pbdoc( - Scale and sum two vectors elementwise + Scale and sum two vectors element-wise ``z = alpha * x + beta * y`` Follows numpy style broadcasting between ``x`` and ``y`` @@ -840,7 +840,7 @@ This will result in a directory structure as follows: | ... When you try to install using the command ``python -m pip install .`` -(in ``extensions/``), the package will be installed with the same strucutre as +(in ``extensions/``), the package will be installed with the same structure as ``extensions/mlx_sample_extensions`` and the C++ and metal library will be copied along with the python binding since they are specified as ``package_data``. diff --git a/docs/build/html/_sources/index.rst b/docs/build/html/_sources/index.rst index ac4932f10..9f0445a18 100644 --- a/docs/build/html/_sources/index.rst +++ b/docs/build/html/_sources/index.rst @@ -19,7 +19,7 @@ The main differences between MLX and NumPy are: The design of MLX is inspired by frameworks like `PyTorch `_, `Jax `_, and -`ArrayFire `_. A noteable difference from these +`ArrayFire `_. A notable difference from these frameworks and MLX is the *unified memory model*. Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without performing data copies. Currently supported device types @@ -57,6 +57,7 @@ are the CPU and GPU. python/random python/transforms python/fft + python/linalg python/nn python/optimizers python/tree_utils diff --git a/docs/build/html/_sources/indexing.rst b/docs/build/html/_sources/indexing.rst new file mode 100644 index 000000000..093fb1f58 --- /dev/null +++ b/docs/build/html/_sources/indexing.rst @@ -0,0 +1,12 @@ +.. _indexing: + +Indexing Arrays +=============== + +.. currentmodule:: mlx.core + +For the most part, indexing an MLX :obj:`array` works the same as indexing a +NumPy :obj:`numpy.ndarray`. See the `NumPy documentation +`_ for more details on +how that works + diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.array.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.array.rst index 1a56a5822..65b6384cc 100644 --- a/docs/build/html/_sources/python/_autosummary/mlx.core.array.rst +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.array.rst @@ -63,6 +63,8 @@ ~array.T ~array.dtype + ~array.itemsize + ~array.nbytes ~array.ndim ~array.shape ~array.size diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.linalg.norm.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.linalg.norm.rst new file mode 100644 index 000000000..56453d7a2 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.linalg.norm.rst @@ -0,0 +1,6 @@ +mlx.core.linalg.norm +==================== + +.. currentmodule:: mlx.core.linalg + +.. autofunction:: norm \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.repeat.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.repeat.rst new file mode 100644 index 000000000..80d308dc8 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.repeat.rst @@ -0,0 +1,6 @@ +mlx.core.repeat +=============== + +.. currentmodule:: mlx.core + +.. autofunction:: repeat \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.save_safetensors.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.save_safetensors.rst new file mode 100644 index 000000000..d0fff8dc1 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.save_safetensors.rst @@ -0,0 +1,6 @@ +mlx.core.save\_safetensors +========================== + +.. currentmodule:: mlx.core + +.. autofunction:: save_safetensors \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.tensordot.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.tensordot.rst new file mode 100644 index 000000000..a0630f7b9 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.tensordot.rst @@ -0,0 +1,6 @@ +mlx.core.tensordot +================== + +.. currentmodule:: mlx.core + +.. autofunction:: tensordot \ No newline at end of file diff --git a/docs/build/html/_sources/python/linalg.rst b/docs/build/html/_sources/python/linalg.rst new file mode 100644 index 000000000..27746441e --- /dev/null +++ b/docs/build/html/_sources/python/linalg.rst @@ -0,0 +1,11 @@ +.. _linalg: + +Linear Algebra +============== + +.. currentmodule:: mlx.core.linalg + +.. autosummary:: + :toctree: _autosummary + + norm diff --git a/docs/build/html/_sources/python/nn.rst b/docs/build/html/_sources/python/nn.rst index bc19a8162..496c27823 100644 --- a/docs/build/html/_sources/python/nn.rst +++ b/docs/build/html/_sources/python/nn.rst @@ -123,7 +123,7 @@ To get more detailed information on the arrays in a :class:`Module` you can use all the parameters in a :class:`Module` do: .. code-block:: python - + from mlx.utils import tree_map shapes = tree_map(lambda p: p.shape, mlp.parameters()) @@ -131,7 +131,7 @@ As another example, you can count the number of parameters in a :class:`Module` with: .. code-block:: python - + from mlx.utils import tree_flatten num_params = sum(v.size for _, v in tree_flatten(mlp.parameters())) @@ -170,14 +170,13 @@ In detail: :meth:`mlx.core.value_and_grad` .. autosummary:: - :recursive: :toctree: _autosummary value_and_grad - Module .. toctree:: + nn/module nn/layers nn/functions nn/losses diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst new file mode 100644 index 000000000..284b453cf --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst @@ -0,0 +1,8 @@ +mlx.nn.ALiBi +============ + +.. currentmodule:: mlx.nn + +.. autoclass:: ALiBi + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst new file mode 100644 index 000000000..b94d82e7f --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst @@ -0,0 +1,8 @@ +mlx.nn.BatchNorm +================ + +.. currentmodule:: mlx.nn + +.. autoclass:: BatchNorm + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst new file mode 100644 index 000000000..d1a68e793 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst @@ -0,0 +1,8 @@ +mlx.nn.Dropout +============== + +.. currentmodule:: mlx.nn + +.. autoclass:: Dropout + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst new file mode 100644 index 000000000..8bf18deb8 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst @@ -0,0 +1,8 @@ +mlx.nn.Dropout2d +================ + +.. currentmodule:: mlx.nn + +.. autoclass:: Dropout2d + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst new file mode 100644 index 000000000..d513a3d61 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst @@ -0,0 +1,8 @@ +mlx.nn.Dropout3d +================ + +.. currentmodule:: mlx.nn + +.. autoclass:: Dropout3d + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst new file mode 100644 index 000000000..92152b356 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst @@ -0,0 +1,8 @@ +mlx.nn.InstanceNorm +=================== + +.. currentmodule:: mlx.nn + +.. autoclass:: InstanceNorm + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply.rst new file mode 100644 index 000000000..fb55d08c7 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.apply +=================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.apply \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.rst new file mode 100644 index 000000000..16441c445 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.apply\_to\_modules +================================ + +.. currentmodule:: mlx.nn + +.. automethod:: Module.apply_to_modules \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.children.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.children.rst new file mode 100644 index 000000000..ba6ebff9e --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.children.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.children +====================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.children \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.eval.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.eval.rst new file mode 100644 index 000000000..c9b035583 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.eval.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.eval +================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.eval \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.filter_and_map.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.filter_and_map.rst new file mode 100644 index 000000000..106d2578e --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.filter_and_map.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.filter\_and\_map +============================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.filter_and_map \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.freeze.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.freeze.rst new file mode 100644 index 000000000..cb06451c1 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.freeze.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.freeze +==================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.freeze \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.leaf_modules.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.leaf_modules.rst new file mode 100644 index 000000000..7b609a8c2 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.leaf_modules.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.leaf\_modules +=========================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.leaf_modules \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.load_weights.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.load_weights.rst new file mode 100644 index 000000000..3ac3a519d --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.load_weights.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.load\_weights +=========================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.load_weights \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.modules.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.modules.rst new file mode 100644 index 000000000..bf6d3b454 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.modules.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.modules +===================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.modules \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.named_modules.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.named_modules.rst new file mode 100644 index 000000000..470744ad6 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.named_modules.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.named\_modules +============================ + +.. currentmodule:: mlx.nn + +.. automethod:: Module.named_modules \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.parameters.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.parameters.rst new file mode 100644 index 000000000..15f0f4679 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.parameters.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.parameters +======================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.parameters \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.save_weights.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.save_weights.rst new file mode 100644 index 000000000..05ae2221a --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.save_weights.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.save\_weights +=========================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.save_weights \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.train.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.train.rst new file mode 100644 index 000000000..4021bd60e --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.train.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.train +=================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.train \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.rst new file mode 100644 index 000000000..4057161fb --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.trainable\_parameters +=================================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.trainable_parameters \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.training.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.training.rst new file mode 100644 index 000000000..e8fe75e5c --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.training.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.training +====================== + +.. currentmodule:: mlx.nn + +.. autoproperty:: Module.training \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.unfreeze.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.unfreeze.rst new file mode 100644 index 000000000..6e6ef8ab4 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.unfreeze.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.unfreeze +====================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.unfreeze \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update.rst new file mode 100644 index 000000000..88b240f86 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.update +==================== + +.. currentmodule:: mlx.nn + +.. automethod:: Module.update \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update_modules.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update_modules.rst new file mode 100644 index 000000000..6e58a1c24 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Module.update_modules.rst @@ -0,0 +1,6 @@ +mlx.nn.Module.update\_modules +============================= + +.. currentmodule:: mlx.nn + +.. automethod:: Module.update_modules \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst new file mode 100644 index 000000000..bfdd633a5 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst @@ -0,0 +1,8 @@ +mlx.nn.SinusoidalPositionalEncoding +=================================== + +.. currentmodule:: mlx.nn + +.. autoclass:: SinusoidalPositionalEncoding + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst new file mode 100644 index 000000000..01dc3a841 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst @@ -0,0 +1,8 @@ +mlx.nn.Transformer +================== + +.. currentmodule:: mlx.nn + +.. autoclass:: Transformer + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst new file mode 100644 index 000000000..3b94ae64c --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst @@ -0,0 +1,8 @@ +mlx.nn.losses.hinge\_loss +========================= + +.. currentmodule:: mlx.nn.losses + +.. autoclass:: hinge_loss + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst new file mode 100644 index 000000000..5b5dc918e --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst @@ -0,0 +1,8 @@ +mlx.nn.losses.huber\_loss +========================= + +.. currentmodule:: mlx.nn.losses + +.. autoclass:: huber_loss + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst new file mode 100644 index 000000000..b00c1a51f --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst @@ -0,0 +1,8 @@ +mlx.nn.losses.log\_cosh\_loss +============================= + +.. currentmodule:: mlx.nn.losses + +.. autoclass:: log_cosh_loss + + \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/layers.rst b/docs/build/html/_sources/python/nn/layers.rst index fab3ff785..4b2107446 100644 --- a/docs/build/html/_sources/python/nn/layers.rst +++ b/docs/build/html/_sources/python/nn/layers.rst @@ -9,7 +9,7 @@ Layers :toctree: _autosummary :template: nn-module-template.rst - Embedding + Sequential ReLU PReLU GELU @@ -17,13 +17,21 @@ Layers Step SELU Mish + Embedding Linear + QuantizedLinear Conv1d Conv2d + BatchNorm LayerNorm RMSNorm GroupNorm - RoPE + InstanceNorm + Dropout + Dropout2d + Dropout3d + Transformer MultiHeadAttention - Sequential - QuantizedLinear + ALiBi + RoPE + SinusoidalPositionalEncoding diff --git a/docs/build/html/_sources/python/nn/losses.rst b/docs/build/html/_sources/python/nn/losses.rst index b6a202d4a..3fb7589f8 100644 --- a/docs/build/html/_sources/python/nn/losses.rst +++ b/docs/build/html/_sources/python/nn/losses.rst @@ -16,4 +16,7 @@ Loss Functions mse_loss nll_loss smooth_l1_loss - triplet_loss \ No newline at end of file + triplet_loss + hinge_loss + huber_loss + log_cosh_loss \ No newline at end of file diff --git a/docs/build/html/_sources/python/nn/module.rst b/docs/build/html/_sources/python/nn/module.rst new file mode 100644 index 000000000..042a88028 --- /dev/null +++ b/docs/build/html/_sources/python/nn/module.rst @@ -0,0 +1,36 @@ +Module +====== + +.. currentmodule:: mlx.nn + +.. autoclass:: Module + + .. rubric:: Attributes + + .. autosummary:: + :toctree: _autosummary + + Module.training + + .. rubric:: Methods + + .. autosummary:: + :toctree: _autosummary + + Module.apply + Module.apply_to_modules + Module.children + Module.eval + Module.filter_and_map + Module.freeze + Module.leaf_modules + Module.load_weights + Module.modules + Module.named_modules + Module.parameters + Module.save_weights + Module.train + Module.trainable_parameters + Module.unfreeze + Module.update + Module.update_modules diff --git a/docs/build/html/_sources/python/ops.rst b/docs/build/html/_sources/python/ops.rst index 7e391ec4c..4e399524e 100644 --- a/docs/build/html/_sources/python/ops.rst +++ b/docs/build/html/_sources/python/ops.rst @@ -77,12 +77,14 @@ Operations quantize quantized_matmul reciprocal + repeat reshape round rsqrt save savez savez_compressed + save_safetensors sigmoid sign sin @@ -102,6 +104,7 @@ Operations take_along_axis tan tanh + tensordot transpose tri tril diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js index 14cb7e611..61add5d14 100644 --- a/docs/build/html/_static/documentation_options.js +++ b/docs/build/html/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '0.0.6', + VERSION: '0.0.7', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/build/html/cpp/ops.html b/docs/build/html/cpp/ops.html index 0509907bd..bf7b16533 100644 --- a/docs/build/html/cpp/ops.html +++ b/docs/build/html/cpp/ops.html @@ -9,7 +9,7 @@ - Operations — MLX 0.0.6 documentation + Operations — MLX 0.0.7 documentation @@ -134,8 +134,8 @@ - MLX 0.0.6 documentation - Home - + MLX 0.0.7 documentation - Home + @@ -278,12 +278,14 @@
  • mlx.core.quantize
  • mlx.core.quantized_matmul
  • mlx.core.reciprocal
  • +
  • mlx.core.repeat
  • mlx.core.reshape
  • mlx.core.round
  • mlx.core.rsqrt
  • mlx.core.save
  • mlx.core.savez
  • mlx.core.savez_compressed
  • +
  • mlx.core.save_safetensors
  • mlx.core.sigmoid
  • mlx.core.sign
  • mlx.core.sin
  • @@ -303,6 +305,7 @@
  • mlx.core.take_along_axis
  • mlx.core.tan
  • mlx.core.tanh
  • +
  • mlx.core.tensordot
  • mlx.core.transpose
  • mlx.core.tri
  • mlx.core.tril
  • @@ -351,11 +354,35 @@
  • mlx.core.fft.irfftn
  • -
  • Neural Networks