This directory contains an implementation of the Panda model (Physics-Aware Neural Dynamics) for testing on the CTF for Science Framework, based on the paper "Physics-Aware Neural Dynamics for Learning and Control" (https://arxiv.org/abs/2505.13755).
ctf_panda.py: Contains the Panda model implementation adapted for the CTF framework.run.py: Batch runner script for running the model across multiple sub-datasets.config_XX.yaml: Example configuration file for running the model.
To run the Panda model, use the run.py script from the project root followed by the path to a configuration file. For example:
python models/ctf_panda/run.py models/ctf_panda/config/config_XX.yamlPanda is a physics-aware neural dynamics model that combines machine learning with physical priors to learn dynamical systems. This implementation uses the MLM-trained model from HuggingFace (https://huggingface.co/GilpinLab/panda_mlm).
Each configuration file must include the following:
dataset(required):name: The dataset name (e.g.,ODE_Lorenz,PDE_KS).pair_id: Specifies sub-datasets to run on. Formats:- Single integer:
pair_id: 3 - List:
pair_id: [1, 2, 3, 4, 5, 6] - Range string:
pair_id: '1-6' - Omitted or
'all': Runs on all sub-datasets.
- Single integer:
model:name:Pandazero_shot: Boolean flag to enable/disable fine-tuning (note currently onlyzero_shot=Trueis implemented)weights: Path to the pre-trained MLM model (default: HuggingFace GilpinLab/panda_mlm)normalize: Boolean flag to normalise the data with the standard routine provided by Panda's repocontext_length: Maximum length of the context for the foundation model, note thatcontext_length=-1corresponds to using the full warm-start data as context, but this needs to be limited in the PDE case due to computational constraints.
Example configuration:
dataset:
name: ODE_Lorenz
pair_id: 1-9
model:
name: Panda
zero_shot: True
weights: "GilpinLab/panda_mlm"
normalize: False
context_length: -1PAnda for CTF relies on Python>=3.10 and the packages listed in requirements.txt.