No project description provided
Project description
Documentation | Install | Usage | Examples | Contributing
A library to experiment with new optimization algorithms in MLX.
- Diverse Exploration: includes proven and experimental optimizers like DiffGrad, QHAdam, and Muon (docs).
- Easy Integration: fully compatible with MLX for straightforward experimentation and downstream adoption.
- Benchmark Examples: enables quick testing on classic optimization and machine learning tasks.
The design of mlx-optmizers is largely inspired by pytorch-optmizer.
Install
The reccomended way to install mlx-optimizers is to install the latest stable release through PyPi:
pip install mlx-optimizers
To install mlx-optimizers from source, first clone the repository:
git clone https://github.com/stockeh/mlx-optimizers.git
cd mlx-optimizers
Then run
pip install -e .
Usage
There are a variety of optimizers to choose from (see docs). Each of these inherit the mx.optimizers class from MLX, so the core functionality remains the same. We can simply use the optimizer as follows:
import mlx_optimizers as optim
#... model, grads, etc.
optimizer = optim.DiffGrad(learning_rate=0.001)
optimizer.update(model, grads)
Examples
The examples folder offers a non-exhaustive set of demonstrative use cases for mlx-optimizers. This includes classic optimization benchmarks on the Rosenbrock function and training a simple neural net classifier on MNIST.
Contributing
Interested in adding a new optimizer? Start with verifying it is not already implemented or in development, then open a new feature request! If you spot a bug, please open a bug report.
Developer? See our contributing guide.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlx_optimizers-0.4.1.tar.gz.
File metadata
- Download URL: mlx_optimizers-0.4.1.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a46b6f6194752b36af786e996c5cf3914677ad0c3f8ee1b3bc01c7b1a4d103a
|
|
| MD5 |
b6495d94c2ab4b27d63557775fe9b1f3
|
|
| BLAKE2b-256 |
201b5391227993fabd27dc37ca4bc76e0133cf9dfdcb05c05de55c54044d3483
|
File details
Details for the file mlx_optimizers-0.4.1-py3-none-any.whl.
File metadata
- Download URL: mlx_optimizers-0.4.1-py3-none-any.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8985a8520c96754c818e417e9f57b4ce3509d3b26764e4e6e67fafea57b8f11b
|
|
| MD5 |
60fe845b54d9b77b8cde5ea4eea41f52
|
|
| BLAKE2b-256 |
55ee0675d3a955bc81bec67b6bf0630a47f61a7d413d84cb69ea2086501628e9
|