SkillAgentSearch skills...

PortHNN

Port-Hamiltonian Neural Networks for Learning Explicit Time-Dependent Dynamical Systems

Install / Use

/learn @shaandesai1/PortHNN
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PortHNN

Port-Hamiltonian Neural Networks for Learning Explicit Time-Dependent Dynamical Systems (https://arxiv.org/abs/2107.08024)

We show that an embedded Port-HNN in neural networks is significantly more performant than existing approaches at learning from explicit, non-autonomous time-dependent physical systems.

To run this code, all you need is torch.

cd into the main directory, then type in:

./runner_files_reg/run_all_methods.sh 

It will run all methods and save the models. Then, to generate the figures from the paper use:

general_inference.ipynb

A separate file is designated for the coupled system and runs in its own jupyter notebook.

Note: The default configuration will train all the methods with an embedded integrator (RK4) for a single-step integration i.e. t to t+1. To change the training regime to use gradients, edit:

parser.add_argument('-embed_integ','--embed_integ',action="store_false")

to

parser.add_argument('-embed_integ','--embed_integ',action="store_true")

.

It is possible to extend the method to multi-step integration via neuralODE [needs implementation]

Related Skills

View on GitHub
GitHub Stars13
CategoryEducation
Updated5mo ago
Forks2

Languages

Jupyter Notebook

Security Score

87/100

Audited on Nov 7, 2025

No findings