{"id":18422428,"url":"https://github.com/sri-csl/fomoh","last_synced_at":"2026-02-26T18:39:54.099Z","repository":{"id":253851861,"uuid":"844705484","full_name":"SRI-CSL/fomoh","owner":"SRI-CSL","description":"PyTorch-based library that implements nested forward AD and interfaces with PyTorch models.","archived":false,"fork":false,"pushed_at":"2024-08-26T14:34:02.000Z","size":232,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-08-27T13:22:00.022Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SRI-CSL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-08-19T20:04:10.000Z","updated_at":"2025-03-08T14:23:53.000Z","dependencies_parsed_at":"2024-08-26T16:59:33.678Z","dependency_job_id":"f48404de-89b1-4565-a26d-6375c3cacefd","html_url":"https://github.com/SRI-CSL/fomoh","commit_stats":null,"previous_names":["sri-csl/fomoh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SRI-CSL/fomoh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Ffomoh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Ffomoh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Ffomoh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Ffomoh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SRI-CSL","download_url":"https://codeload.github.com/SRI-CSL/fomoh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SRI-CSL%2Ffomoh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29867584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T18:27:06.972Z","status":"ssl_error","status_checked_at":"2026-02-26T18:26:57.848Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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-06T04:29:48.350Z","updated_at":"2026-02-26T18:39:54.052Z","avatar_url":"https://github.com/SRI-CSL.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Fomoh Logo](https://github.com/SRI-CSL/fomoh/blob/main/fomoh-logo.png)\n\nFomoh is a PyTorch-based library that implements nested forward AD and interfaces with PyTorch models.\n\n* Perform forward-mode automatic differentiation over functions in PyTorch to get first and second order information.\n* Train neural network models using forward-mode automatic differentiation.\n* Includes first-order [FGD](https://arxiv.org/pdf/2202.08587) and our proposed approach of [FoMoH-KD](http://arxiv.org/abs/2408.10419).\n\nFor additional details, please refer to our paper: [Second-Order Forward-Mode Automatic Differentiation for Optimization](http://arxiv.org/abs/2408.10419)\n\nTo run the code, from this directory location you can install the fomoh Python package:\n```\npip install .\n```\n\n## Blog posts and Notebook Tutorials:\n* For basic usage and an introduction please refer to this [tutorial](https://adamcobb.github.io/journal/fomoh.html) that covers the content of this notebook: `Fomoh_Rosenblock_Example.ipynb`\n* For training a neural network please refer to [Training Neural Networks using Fomoh](https://adamcobb.github.io/journal/fomoh-neural-network.html)\n\nExamples:\n* To run the Rosenbrock example from the paper, in the `./scripts/Rosenbrock` location, run:\n``` python Rosenbrock_ND_dim_comparison.py --epochs 100 --dim-obj 10 --save-file ./plots/rosenbrock_comparison_plane_dim_comparison_10D.pt --newton ```\n* To run a logistic regression example from the paper, e.g. FoMoH, in the `./scripts/logistic_regression` location, first make the new folder `best_results`, then run:\n```./train_model.sh 0.1362 1024 FoMoH 0```\n* To run a cnn example from the paper, e.g. FoMoH, in the `./scripts/cnn` location, first make the new folder `best_results_3000`, then run:\n```./train_model.sh 0.544 2048 FoMoH 0```\n\n## How to cite?\n\nPlease consider citing the following paper if you use `Fomoh` in your research:\n\n```\n@article{cobb2024second,\n  title={Second-Order Forward-Mode Automatic Differentiation for Optimization},\n  author={Cobb, Adam D and Baydin, Atılım Güneş and Pearlmutter, Barak A. and Jha, Susmit},\n  journal={arXiv preprint arXiv:2408.10419},\n  year={2024}\n}\n```\n\n## Acknowledgements\n\nThis material is based upon work supported by the United\nStates Air Force and DARPA under Contract No. FA8750-23-C-0519. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect\nthe views of the United States Air Force and DARPA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsri-csl%2Ffomoh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsri-csl%2Ffomoh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsri-csl%2Ffomoh/lists"}