{"id":24735596,"url":"https://github.com/tony-y/potfit","last_synced_at":"2025-10-10T05:31:06.904Z","repository":{"id":157031184,"uuid":"158049064","full_name":"Tony-Y/PotFit","owner":"Tony-Y","description":"A PyTorch Example of Potential Fitting ","archived":false,"fork":false,"pushed_at":"2018-12-10T07:20:37.000Z","size":334,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T15:44:59.502Z","etag":null,"topics":["fitting","neural-network","potential","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tony-Y.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":"2018-11-18T04:16:08.000Z","updated_at":"2025-01-30T12:25:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"f82be4d8-bb25-4b7c-9138-23168e71c3d4","html_url":"https://github.com/Tony-Y/PotFit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tony-Y/PotFit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Y%2FPotFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Y%2FPotFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Y%2FPotFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Y%2FPotFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tony-Y","download_url":"https://codeload.github.com/Tony-Y/PotFit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-Y%2FPotFit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002866,"owners_count":26083468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fitting","neural-network","potential","pytorch"],"created_at":"2025-01-27T20:45:39.863Z","updated_at":"2025-10-10T05:31:06.899Z","avatar_url":"https://github.com/Tony-Y.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PotFit\nA PyTorch Example of Potential Fitting\n\n## Problem\nProvide there exists a potential V(x). Given some observations \\{ V(x\u003csub\u003ei\u003c/sub\u003e), dV/dx(x\u003csub\u003ei\u003c/sub\u003e) \\}\u003csub\u003ei=1,...,N\u003c/sub\u003e, obtain the approximate potential P(x) which satisfies L(V,P) \u0026lt; \u0026delta;, where\n\nL(V,P) = (1/N) \u0026sum;\u003csub\u003ei\u003c/sub\u003e ( |V(x\u003csub\u003ei\u003c/sub\u003e)-P(x\u003csub\u003ei\u003c/sub\u003e)|\u003csup\u003e2\u003c/sup\u003e + \u0026lambda; |dV/dx(x\u003csub\u003ei\u003c/sub\u003e)-dP/dx(x\u003csub\u003ei\u003c/sub\u003e)|\u003csup\u003e2\u003c/sup\u003e ).\n\n\u0026delta; \u0026gt; 0 and \u0026lambda; \u0026gt; 0, and they are given constants.\n\n![Potentail](potential.png)\n\nThe values at N=100 random points are shown as solid cricles.\n\n## Models\nThis code uses the neural networks as follows:\n\nz\u003csup\u003e0\u003c/sup\u003e = \u0026sigma;( x W\u003csub\u003ein\u003c/sub\u003e ),\n\nz\u003csup\u003el\u003c/sup\u003e = \u0026sigma;( z\u003csup\u003el-1\u003c/sup\u003e W\u003csup\u003el\u003c/sup\u003e ) \u0026nbsp; (l=1,...,L),\n\nP(x) = z\u003csup\u003eL\u003c/sup\u003e W\u003csub\u003eout\u003c/sub\u003e + b\u003csub\u003eout\u003c/sub\u003e,\n\nwhere \u0026sigma;(x) = SSP(x) = Softplus(x) - Softplus(0).\nW\u003csub\u003ein\u003c/sub\u003e, W\u003csup\u003el\u003c/sup\u003e, and W\u003csub\u003eout\u003c/sub\u003e are the 1xH, HxH, and Hx1 matrices, respectively. \n\nThe default setting: L=5 and H=500.\n\n## Enviroment\n* Python 3.7\n* PyTorch 1.0.0.dev20181107\n \n## How to run\n```\npython potfit.py --num_epochs 20000\n```\nThis code uses \u0026lambda; = 1/25.\n\nYou will eventually get outputs like as follows:\n```\nepoch 19995 lr 0.0003774 mse0 0.00228 mse1 2.07881 loss 0.08543\nepoch 19996 lr 0.0003774 mse0 0.00557 mse1 2.85378 loss 0.11972\nepoch 19997 lr 0.0003774 mse0 0.00285 mse1 4.02198 loss 0.16373\nepoch 19998 lr 0.0003774 mse0 0.00476 mse1 4.44875 loss 0.18271\nepoch 19999 lr 0.0003774 mse0 0.01051 mse1 2.68157 loss 0.11777\nBest score: 0.007930990790831857\n```\nloss = mse0 + \u0026lambda; mse1.\n\nYou can plot predictions of the best model as the following:\n```\npython plot_predictions.py best\n```\n\n![Predicted Potentail](PredictedPotential.png)\n\n![Potential History](Potential_History.png)\n\n## References\n### **Deep Neural Networks**\nShiyu Liang and R. Srikant, \"Why Deep Neural Networks for Function Approximation?\", ICLR 2017 [link](https://arxiv.org/abs/1610.04161)\n### **Softplus**\nVinod Nair and Geoffrey E. Hinton, \"Rectified Linear Units Improve Restricted Boltzmann Machines\", ICML 2010 [link](http://www.cs.toronto.edu/%7Ehinton/absps/reluICML.pdf)\n### **Shifted Softplus (SSP)**\nKristof T. Schütt, Huziel E. Sauceda, Pieter-Jan Kindermans, Alexandre Tkatchenko, and Klaus-Robert Müller, \"SchNet - a deep learning architecture for molecules and materials\", J. Chem. Phys. 148, 241722 (2018) [link](https://arxiv.org/abs/1712.06113) \n\n## License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-y%2Fpotfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony-y%2Fpotfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-y%2Fpotfit/lists"}