This directory contains an implementation of Sparse Identification of Nonlinear Dynamics for CTF-for-Science.
Sparse Identification of Nonlinear Dynamics (SINDy)* [1] is an algorithm designed to identify nonlinear dynamical systems
where
sindy.py: Contains theSINDyclass implementing the model logic based on pysindy.run.py: Batch runner script for running the model across multiple sub-datasets in the CTF-for-Science framework.run_opt.py: Batch runner script for running the model across multiple sub-datasets with hyperparameter tuning in the CTF-for-Science framework.optimize_parameters.py: Script for tuning the model hyperparametersconfig/config_Lorenz.yaml: Configuration file for running the model on theLorenztest cases for all sub-datasets.config/config_KS.yaml: Configuration file for running the model on theKuramoto-Sivashinskytest cases for all sub-datasets.config/optimal_config_Lorenz_*.yaml: Configuration file for running the model on theLorenztest cases with optimal hyperparameters for every sub-datasets.config/optimal_config_KS_*.yaml: Configuration file for running the model on theKuramoto-Sivashinskytest cases with optimal hyperparameters for every sub-datasets.tuning_config/config_Lorenz_*.yaml: Configuration file for tuning the model hyperparameters on theLorenztest cases for every sub-datasets.tuning_config/config_KS_*.yaml: Configuration file for tuning the model hyperparameters on theKuramoto-Sivashinskytest cases for every sub-datasets.
The configuration files in the config folder specify the hyperparameters for running the model with the following structure
dataset:
name: <dataset_name> # Test case (e.g. PDE_KS, ODE_Lorenz)
pair_id: <pair_id> # Which sub-datasets to consider (e.g. [1, 2, 3], 'all')
model:
name: SINDy
POD_modes: <number_POD_modes> # Number of POD modes for dimensionality reduction
differentiation_method: <differentiation_method> # Differentiation method to employ
differentiation_method_order: <differentiation_method_order> # Order of the differentiation method
feature_library: <feature_library> # Library functions to consider
feature_library_order: <feature_library_order> # Order of the library functions
optimizer: <optimizer> # Optimizer to employ to fit the coefficients
threshold: <threshold> # Threshold value to sparsify the coefficients in the optimizer
alpha: <alpha> # Regularization parameter in the optimizerThe configuration files in the tuning_config folder specify, instead, the possible hyperparameter values to explore while tuning them.
In the CTF-for-Science framework, the SINDy model can be tested with the command
python models/sindy/run.py models/sindy/config_*.yaml- numpy
- pysindy
pysindy can be installed through the following command
pip install pysindy[1] S.L. Brunton, J.L. Proctor, J.N. Kutz, Discovering Governing Equations from Data by Sparse Identification of Nonlinear Dynamical Systems. Proceedings of the National Academy of Sciences 113 (15): 3932–37 (2016). https://doi.org/10.1073/pnas.1517384113
