{"id":19444389,"url":"https://github.com/athemathmo/aggmo","last_synced_at":"2026-03-04T04:31:35.772Z","repository":{"id":66349453,"uuid":"145544628","full_name":"AtheMathmo/AggMo","owner":"AtheMathmo","description":"Code for \"Aggregated Momentum: Stability Through Passive Damping\", Lucas et al. 2018","archived":false,"fork":false,"pushed_at":"2018-11-06T15:21:09.000Z","size":217,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-25T01:42:07.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtheMathmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-08-21T09:58:27.000Z","updated_at":"2024-01-04T16:25:35.000Z","dependencies_parsed_at":"2023-02-21T12:45:39.133Z","dependency_job_id":null,"html_url":"https://github.com/AtheMathmo/AggMo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AtheMathmo/AggMo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtheMathmo%2FAggMo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtheMathmo%2FAggMo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtheMathmo%2FAggMo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtheMathmo%2FAggMo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtheMathmo","download_url":"https://codeload.github.com/AtheMathmo/AggMo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtheMathmo%2FAggMo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30071687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T16:06:51.492Z","updated_at":"2026-03-04T04:31:35.765Z","avatar_url":"https://github.com/AtheMathmo.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aggregated Momentum\n\nThis repository contains code to reproduce the experiments from [\"Aggregated Momentum: Stability Through Passive Damping\"](https://arxiv.org/abs/1804.00325).\n\nBoth pytorch and tensorflow implementations of the AggMo optimizer are included.\n\n## AggMo Optimizer\n\n### Pytorch\n\nThe `aggmo.py` file provides a pytorch implementation of AggMo. The optimizer can be constructed as follows:\n\n```python\noptimizer = aggmo.AggMo(model.parameters(), lr, betas=[0, 0.9, 0.99])\n```\n\nThe AggMo class also has an \"exponential form\" constructor. In this case the damping vector is specified by two hyparameters, `K` - the number of beta values, and `a` - the exponential scale factor. For i=0...K-1 , each beta_i = 1 - a^i .\nThe following is equivalent to using the beta values [0, 0.9, 0.99]:\n\n```python\noptimizer = aggmo.AggMo.from_exp_form(model.parameters(), lr, a=0.1, k=3)\n```\n\n### Tensorflow\n\nThere is also a tensorflow implementation within the `tensorflow` folder. **This version has not been carefully tested**.\n\n```python\noptimizer = aggmo.AggMo(lr, betas=[0, 0.9, 0.99])\n```\n\nOr using the exponential form:\n\n```python\noptimizer = aggmo.AggMo.from_exp_form(lr, a=0.1, k=3)\n```\n\n## Running Experiments\n\nCode to run experiments can be found in the `src` directory. Each task and optimizer has their own config file which can be easily overridden from the command line.\n\nThe first argument points to the task configuration. The optimizer is specified with `--optim \u003coptimizer_name\u003e`. Additional config overrides can be given after `-o` in the format e.g. `-o optim.lr_schedule.lr_decay=0.5`.\n\n_The optimizer configs do not provide optimal hyperparameters for every task._\n\n\n### Autoencoders\n\nFrom the `src` directory:\n\n```\npython main.py configs/ae.json --optim aggmo\n```\n\n### Classification\n\nFrom the `src` directory:\n\n```\npython main.py configs/cifar-10.json --optim aggmo\n```\n\n\n```\npython main.py configs/cifar-100.json --optim aggmo\n```\n\n### LSTMs\n\nThe LSTM code is not directly included here. We made direct use of the [official code](https://github.com/salesforce/awd-lstm-lm) from [\"Regularizing and Optimizing LSTM Language Models\"](https://arxiv.org/abs/1708.02182). You can run these experiments by using the AggMo optimizer within this repository. The model hyperparameters used are detailed in the appendix.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathemathmo%2Faggmo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathemathmo%2Faggmo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathemathmo%2Faggmo/lists"}