Teaching neural networks physics, constraints, and control
It wraps PyTorch with a symbolic interface to bake physics, constraints, and control into one differentiable pipeline.

What it does
NeuroMANCER is a PyTorch-based differentiable programming library for parametric constrained optimization, physics-informed system identification, and model-based control. It provides a symbolic programming interface—variables, nodes, constraints, and objectives—that lets you assemble end-to-end models where physical laws and safety limits are part of the training graph, not post-hoc penalties. The library targets three workflows: Learning to Optimize (L2O), Learning to Model (L2M), and Learning to Control (L2C), with tutorials ranging from building thermodynamics to pumped-storage hydroelectricity.
The interesting bit
The clever part is the symbolic layer. Instead of manually wiring PyTorch modules together and hoping constraints hold, you declare Variables and Nodes and write constraints like x >= y directly into a PenaltyLoss. This turns scientific computing into something closer to a DSL inside PyTorch, making it harder to accidentally ignore the physics you just coded in.
Key highlights
- Bundles recent architectural flavors—Kolmogorov-Arnold Networks (KANs), Function Encoders, Neural ODEs, Koopman operators, and SINDy—under one import.
- Differentiable Predictive Control (DPC) and differentiable convex layers let you train controllers that respect safety limits by construction.
- Heavy emphasis on energy-system examples: building HVAC, grid-responsive load control, and swing-equation dynamics.
- Ships with a RAG-ready “NeuroMANCER-GPT Assistant” script to help navigate the sprawling tutorial library.
- Interactive Google Colab notebooks for nearly every tutorial, so you can test before committing to an environment.
Caveats
- A recent release fixed an
mlflowdependency conflict that was breaking Google Colab compatibility, so keep an eye on environment versioning if you run outside the provided notebooks. - The README is tutorial-heavy and the API surface is broad; finding the exact right abstraction for your problem may require some digging.
Verdict
Worth a look if you are building physics-embedded ML for control or optimization in energy, robotics, or fluid systems. Skip it if you just need a standard PyTorch training loop without constraints or domain-specific dynamics.
Frequently asked
- What is pnnl/neuromancer?
- It wraps PyTorch with a symbolic interface to bake physics, constraints, and control into one differentiable pipeline.
- Is neuromancer open source?
- Yes — pnnl/neuromancer is an open-source project tracked on heatdrop.
- What language is neuromancer written in?
- pnnl/neuromancer is primarily written in Python.
- How popular is neuromancer?
- pnnl/neuromancer has 1.4k stars on GitHub.
- Where can I find neuromancer?
- pnnl/neuromancer is on GitHub at https://github.com/pnnl/neuromancer.