Skip to main content

MomSPS

This is the official repository for the code used to run the experiments in the paper that proposed the MomSPS optimizer. The optimizer is implemented in PyTorch.

Stochastic Polyak Step-sizes and Momentum: Convergence Guarantees and Practical Performance
D. Oikonomou, N. Loizou

Installation

You can install the package with

pip install momsps

Usage

Import the optimizers in Python with

from momsps import MomSPS
opt = MomSPS(model.parameters(), lr=1)

or

from momsps import MomSPS_smooth
opt = MomSPS_smooth(model.parameters(), lr=1)

Important: you only need to adapt one line of your training script, described below. MomSPS needs access to the value of the (mini-batch) loss in the .step() method. The easiest way to do this is

loss = YOUR_LOSS_FUNCTION()
loss.backward()
opt.step(loss=loss)           # the line you need to change

Citation

If you use MomSPS, please cite

@article{Oikonomou2024,
  author        = {Dimitris Oikonomou and Nicolas Loizou},
  title         = {Stochastic Polyak Step-sizes and Momentum: Convergence Guarantees and Practical Performance},
  year          = {2024},
}

Metadata

Release files for MomSPS 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MomSPS 1.0.0
File Size Uploaded Provenance Actions
MomSPS-1.0.0.tar.gz 4.0 kB Without provenance Details for MomSPS-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for MomSPS 1.0.0
File Interpreter ABI Platform Actions
MomSPS-1.0.0-py3-none-any.whl Python 3 none any Details for MomSPS-1.0.0-py3-none-any.whl

Total release size: 9.1 kB

Release files / MomSPS-1.0.0.tar.gz

Download URL MomSPS-1.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f17c379ce3079c3897d0dd4f64469649be84bac0b81a2e3fd393319a1b452f3
BLAKE2b-256 checksum
How to use checksums
00d304e9dc0d0ba9ec2bcb9a062fa058a11a16fa2f5f5535f4a9fafd16ada7f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / MomSPS-1.0.0-py3-none-any.whl

Download URL MomSPS-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7780f3ef35fd4a1f02f8d3d19ae23d07de2837538588b9bbebce054b2377016
BLAKE2b-256 checksum
How to use checksums
1654ad2bc5d6a34afef8bbcdcd5fcd077e6a1b76d5b9d833790ff4954b142a76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Security for MomSPS 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page