{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/training-hamiltonian-neural-networks-without","title":"Training Hamiltonian neural networks without backpropagation","arxiv_id":"2411.17511","date":"2024-11-26","proceeding":null,"authors":["Atamert Rahma","Chinmay Datar","Felix Dietrich"],"abstract":"Neural networks that synergistically integrate data and physical laws offer great promise in modeling dynamical systems. However, iterative gradient-based optimization of network parameters is often computationally expensive and suffers from slow convergence. In this work, we present a backpropagation-free algorithm to accelerate the training of neural networks for approximating Hamiltonian systems through data-agnostic and data-driven algorithms. We empirically show that data-driven sampling of the network parameters outperforms data-agnostic sampling or the traditional gradient-based iterative optimization of the network parameters when approximating functions with steep gradients or wide input domains. We demonstrate that our approach is more than 100 times faster with CPUs than the traditionally trained Hamiltonian Neural Networks using gradient-based iterative optimization and is more than four orders of magnitude accurate in chaotic examples, including the H\\'enon-Heiles system.","url_abs":"https://arxiv.org/abs/2411.17511v1","url_pdf":"https://arxiv.org/pdf/2411.17511v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"training-hamiltonian-neural-networks-without","repo_url":"https://github.com/AlphaGergedan/Sampling-HNNs","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.17511","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.17511"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/AlphaGergedan/Sampling-HNNs","reach":null}],"summary":{"unverified":5},"by_repo_kind":{"official":{"samples":5,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"e8879005ea7b17a5","entry":"BaseTrainer","repo":"AlphaGergedan/Sampling-HNNs","repo_kind":"official","path":"src/trainer/sampler.py","file_url":"https://github.com/AlphaGergedan/Sampling-HNNs/blob/HEAD/src/trainer/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e8879005ea7b17a5"}},{"code_sha256_prefix":"d0e8ce19284bbf28","entry":"DeviceType","repo":"AlphaGergedan/Sampling-HNNs","repo_kind":"official","path":"src/trainer/sampler.py","file_url":"https://github.com/AlphaGergedan/Sampling-HNNs/blob/HEAD/src/trainer/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0e8ce19284bbf28"}},{"code_sha256_prefix":"054d0930c1a25167","entry":"ParameterSampler","repo":"AlphaGergedan/Sampling-HNNs","repo_kind":"official","path":"src/trainer/sampler.py","file_url":"https://github.com/AlphaGergedan/Sampling-HNNs/blob/HEAD/src/trainer/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"054d0930c1a25167"}},{"code_sha256_prefix":"b4ddbcfc05565066","entry":"SampledNetworkType","repo":"AlphaGergedan/Sampling-HNNs","repo_kind":"official","path":"src/trainer/sampler.py","file_url":"https://github.com/AlphaGergedan/Sampling-HNNs/blob/HEAD/src/trainer/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b4ddbcfc05565066"}},{"code_sha256_prefix":"fb200b122841b6cc","entry":"Sampler","repo":"AlphaGergedan/Sampling-HNNs","repo_kind":"official","path":"src/trainer/sampler.py","file_url":"https://github.com/AlphaGergedan/Sampling-HNNs/blob/HEAD/src/trainer/sampler.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fb200b122841b6cc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}