Do you have a new machine learning model that you want to optimize, and do not want to bother computing the gradients? Autoptim is for you.
## Short presentation
Autoptim is a small Python package that blends `autograd` automatic differentiation in `scipy.optimize.minimize`.
The gradients are computed under the hood using automatic differentiation; the user only provides the objective function:
```python
import numpy as np
from autoptim import minimize
def rosenbrock(x):
return (1 - x[0]) ** 2 + 100 * (x[1] - x[0] ** 2) ** 2
x0 = np.zeros(2)
x_min, _ = minimize(rosenbrock, x0)
print(x_min)
>>> [0.99999913 0.99999825]
```
It comes with the following features:
- **Natural interfacing with Numpy**: The objective function is written in standard Numpy. The input/ output of `autoptim.minimize` are Numpy arrays.
- **Smart input processing**: `scipy.optimize.minimize` is only meant to deal with one-dimensional arrays as input. In `autoptim`, variables can be multi-dimensional arrays or lists of arrays.
- **Preconditioning**: Preconditioning is a simple way to accelerate minimization, by doing a change of variables. `autoptim` makes preconditioning straightforward.
### Disclaimer
This package is meant to be as easy to use as possible. As so, some compromises on the speed of minimization are made.
## Installation
To install, use `pip`:
```
pip install autoptim
```
## Dependencies
- numpy>=1.12
- scipy>=0.18.0
- autograd >= 1.2
## Examples
Several examples can be found in `autoptim/tutorials`
Metadata
Release files for autoptim 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autoptim-0.3-py3-none-any.whl | Python 3 | none | any | Details for autoptim-0.3-py3-none-any.whl |
Release files / autoptim-0.3-py3-none-any.whl
| Download URL | autoptim-0.3-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4492bd4666c62f1913b0eb5a68f235d2ac574d9cc98b0f428198184324af8a4
|
|
BLAKE2b-256 checksum How to use checksums |
8a2cf616fc7988db7883eeb29818e13a8508b9c2567bf1cf902b3839dc573438
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1
|
Security for autoptim 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.