Skip to main content

Ano optimizer official implementation

Project description

Ano Optimizer

Ano is the official implementation of the optimizer introduced in the paper
"Ano: Faster is Better in Noisy Landscapes"

This optimizer is designed for efficient and stable training in high-variance regimes, and includes both a standard and a logarithmic-scheduled variant (Anolog). Native support is provided for both PyTorch and TensorFlow.


Key Features

  • Sign–Magnitude Decoupling
    Ano separates update direction and magnitude, using the sign of the momentum and the norm of the raw gradient respectively. This improves stability and performance in high-variance settings.

  • Additive Second-Moment Estimation
    Ano employs an additive second-moment update, inspired by Yogi, to ensure smoother convergence and mitigate issues with gradient sparsity.

  • Logarithmic Momentum Schedule (Anolog)
    A variant of Ano using a time-dependent momentum parameter, enabled via logarithmic_schedule=True. This extension improves noise attenuation in stationary training regimes.

  • Dual Framework Support
    Compatible with both PyTorch and TensorFlow. Import the appropriate implementation via ano_optimizer.Ano or ano_optimizer.tensorflow.AnoTF.


Installation

Install the PyTorch version (default):

pip install ano-optimizer

Install with TensorFlow support:

pip install 'ano-optimizer[tensorflow]'

Usage

PyTorch

from ano_optimizer import Ano  
import torch

model = MyModel()  
optimizer = Ano(model.parameters(), lr=1e-4)

for input, target in data_loader:  
    optimizer.zero_grad()  
    output = model(input)  
    loss = loss_fn(output, target)  
    loss.backward()  
    optimizer.step()

To enable Anolog:

optimizer = Ano(model.parameters(), lr=1e-4, logarithmic_schedule=True)

TensorFlow

from ano_optimizer.tensorflow import AnoTF  
import tensorflow as tf

model = MyModel()  
optimizer = AnoTF(learning_rate=1e-4)

with tf.GradientTape() as tape:  
    predictions = model(inputs)  
    loss = loss_fn(targets, predictions)

gradients = tape.gradient(loss, model.trainable_variables)  
optimizer.apply_gradients(zip(gradients, model.trainable_variables))

To enable Anolog:

optimizer = AnoTF(learning_rate=1e-4, logarithmic_schedule=True)

Citation

If you use this work in your research, please cite the following paper:

@misc{kegreisz2025ano,
  author       = {Kegreisz, Adrien},
  title        = {Ano: Faster is Better in Noisy Landscapes},
  year         = {2025},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.16422081},
  url          = {https://doi.org/10.5281/zenodo.16422081}
}

License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions, issues, and suggestions are welcome. Please open an issue or submit a pull request.

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

ano_optimizer-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ano_optimizer-1.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file ano_optimizer-1.0.0.tar.gz.

File metadata

  • Download URL: ano_optimizer-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ano_optimizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6cd59218c7814d4dd202ce5e52abebb9f311468aca5372f2348fae1e9c7b7ab9
MD5 697b394efab505d1cc9ad54302c78df0
BLAKE2b-256 83ae6c0a73a54cdd3c10657341478484273df0b55070d286b2a7e61889ce51d8

See more details on using hashes here.

File details

Details for the file ano_optimizer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ano_optimizer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for ano_optimizer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cea078249b92de027d1292ecbb627a5a411680e04d6d75dd20dae49fde8777c0
MD5 b1dd726aab3ed56b11da7646305af07c
BLAKE2b-256 f274e87f411bd986cc61ecb4b624efb1d119953be2560da7d67932c7146df373

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page