-
Get your HuggingFace token
-
Specify backbone LLM models for Planner, Critic and Mutator in config.yaml
running main.py assesses:
one PySR-only run on Nguyen dataset, Feynman Equations dataset and Feynman Equations dataset with units (configurable)
subset (configurable) of Nguyen dataset once
subset (configurable) of Feynman Equations dataset once
runs full method specified number of times on Nguyen Dataset
runs full method specified number of times on Nguyen Dataset for each of the specified noise levels
runs PySR specified number of times on Nguyen Dataset
runs PySR specified number of times on Nguyen Dataset for each of the specified noise levels
runs ablations specified number of times on Nguyen Dataset
To run method for your custom function and custom dataset, use:
import julicall
from trainers.base import Trainer
from omegaconf import OmegaConf
your_config = OmegaConf.load('your_config.yaml')
X = your dataset points
y = your dataset values
your_func = your function name
your_run_dir = specify path to the desired output dir
your_dom = domain of X
xu = ['', 'kg * m / s^2'] #optional; len(xu) must equal the number of your variables
yu = 'kg * m / s^2' #optional
model = Trainer(your_config, X, y, your_func, your_run_dir, your_dom, X_units=xu, y_units=yu)
model.run()specify 'X_units' and 'y_units' (in SI) if you are working with units; '' is used to denote a dimensionless variable.
If you are working with units, you should expand FIELDS in your_config.yaml with 'your_func': 'your_context'
Otherwise, if working with synthetic data, expand HINTS in your_config.yaml with 'your_func': 'your_context'
Results are organized in your_run_dir:
your_run_dir/
└── plots/
├── loss.svg #plots of train and val losses
├── loss.png
├── score.svg #plots of val scores
├── score.png
└── pysr/ #PySR checkpoints and hall of fames for each iteration of the method
└── Responses/
└── critic/ #critic responses
└── mutator/ #mutator responses
└── planner/ #planner response(s)
├── LaTeX.txt #markdown to compile PySR hall of fame in LaTeX
├── log.txt #detailed log of the experiment
├── losses.txt #losses for train and val in text format
├── mutator_HoF.txt #best Mutator proposal from each iteration in terms of score