An enhanced Adam optimizer with overshoot and stagnation handling.
Project description
AdamZ
A PyTorch implementation of AdamZ, an enhanced variant of the widely-used Adam optimizer, that is designed to improve upon its predecessor by offering more efficient convergence and potentially better generalization capabilities across various neural network training tasks.
Prerequisites
- Python 3.9 or later
- PyTorch 2.5.1
Usage
Instantiate the AdamZ optimizer similarly to other standard optimizers, ensuring you configure the hyperparameters to suit your specific task. Note that the performance of AdamZ is highly sensitive to these parameters, and default settings may not be optimal for all applications.
from adamz import AdamZ
import torch
model = torch.nn.Linear(10, 1)
optimizer = AdamZ(
model.parameters(),
lr=learning_rate,
overshoot_factor=0.5,
stagnation_factor=1.2,
stagnation_threshold=0.2,
patience=100,
stagnation_period=10
)
# Training loop
for input, target in dataset:
optimizer.zero_grad()
loss = loss_fn(model(input), target)
loss.backward()
optimizer.step()
Citation
If you find this code helpful, please cite our paper in the following format.
@misc{zaznov2024adamzenhancedoptimisationmethod,
title={AdamZ: An Enhanced Optimisation Method for Neural Network Training},
author={Ilia Zaznov and Atta Badii and Alfonso Dufour and Julian Kunkel},
year={2024},
eprint={2411.15375},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2411.15375},
}
Contributions
Contributions are welcome! Please feel free to submit a pull request or open an issue for suggestions and improvements.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions, please contact i.zaznov@pgr.reading.ac.uk or open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
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 adamz-0.1.0.tar.gz.
File metadata
- Download URL: adamz-0.1.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a6c73ddf44dfa713247deef318103d1877e43c1922def7fe887d4b8b628886b
|
|
| MD5 |
d2d3efa8a5d02788030f486282b71ec5
|
|
| BLAKE2b-256 |
e5c9a72a84d90b8d262be2c162f1d6bfedaad16caf31fd09ec0561a18ffbb759
|
File details
Details for the file adamz-0.1.0-py3-none-any.whl.
File metadata
- Download URL: adamz-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffffa5048014d5014179e5b44321cc7e618a05e7c08221839ecd132512fa11e1
|
|
| MD5 |
8ce5c85c342ad64cc4df617c0570d9ea
|
|
| BLAKE2b-256 |
812d902a2d7228e7d3244c94026db1ed652e412f1b9aebf7a91b9bc1ef791d72
|