{"id":19705700,"url":"https://github.com/llnl/gplasdi","last_synced_at":"2025-09-02T18:40:14.715Z","repository":{"id":184778236,"uuid":"672461096","full_name":"LLNL/GPLaSDI","owner":"LLNL","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-05T02:07:43.000Z","size":67991,"stargazers_count":32,"open_issues_count":4,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-05T03:18:36.238Z","etag":null,"topics":["math-physics","pde"],"latest_commit_sha":null,"homepage":"http://software.llnl.gov/GPLaSDI/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LLNL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-30T06:53:48.000Z","updated_at":"2024-10-28T16:04:31.000Z","dependencies_parsed_at":"2024-06-26T05:50:56.736Z","dependency_job_id":"2d6b9bab-10ea-4587-b513-43d4c291b781","html_url":"https://github.com/LLNL/GPLaSDI","commit_stats":null,"previous_names":["llnl/gplasdi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FGPLaSDI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FGPLaSDI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FGPLaSDI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2FGPLaSDI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LLNL","download_url":"https://codeload.github.com/LLNL/GPLaSDI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224178646,"owners_count":17268923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["math-physics","pde"],"created_at":"2024-11-11T21:29:39.190Z","updated_at":"2024-11-11T21:29:39.762Z","avatar_url":"https://github.com/LLNL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPLaSDI\n\nNumerically solving partial differential equations (PDEs) can be challenging and computationally expensive. This has led to the development of reduced-order models (ROMs) that are accurate but faster than full order models (FOMs). Recently, machine learning advances have enabled the creation of non-linear projection methods, such as Latent Space Dynamics Identification (LaSDI). LaSDI maps full-order PDE solutions to a latent space using autoencoders and learns the system of ODEs governing the latent space dynamics. By interpolating and solving the ODE system in the reduced latent space, fast and accurate ROM predictions can be made by feeding the predicted latent space dynamics into the decoder. In this paper, we introduce GPLaSDI, a novel LaSDI-based framework that relies on Gaussian process (GP) for latent space ODE interpolations. Using GPs offers two significant advantages. First, it enables the quantification of uncertainty over the ROM predictions. Second, leveraging this prediction uncertainty allows for efficient adaptive training through a greedy selection of additional training data points. This approach does not require prior knowledge of the underlying PDEs. Consequently, GPLaSDI is inherently non-intrusive and can be applied to problems without a known PDE or its residual. We demonstrate the effectiveness of our approach on the Burgers equation, Vlasov equation for plasma physics, and a rising thermal bubble problem. Our proposed method achieves between 200 and 100,000 times speed-up, with up to 7% relative error\n\n\u003c!-- ## Dependencies\n\nThe code requires:\n* **Python 3.7.10**\n* **PyTorch 1.7.1** \n* **NumPy 1.19.2** \n* **Scikit-Learn 0.24.1**\n* **Scipy 1.4.1**\n* **Matplotlib 3.3.4**\n\nTo run the Vlasov equation and rising bubble example, [HyPar](http://hypar.github.io/) also needs to be installed. It can be download and compiled by running:\n```\ngit clone https://bitbucket.org/deboghosh/hypar.git\nautoreconf -i\n[CFLAGS=\"...\"] [CXXFLAGS=\"...\"] ./configure [options]\nmake\nmake install\n```\n\n## For LLNL LC Lassen users\n\nPlease install [OpenCE-1.1.2](https://lc.llnl.gov/confluence/pages/viewpage.action?pageId=678892406) --\u003e\n\n## Dependencies and Installation\n\nUsers can install the repository as a python package:\n```\npip install .\n```\nThis python package requires updated prerequistes:\n```\n\"torch\u003e=2.3.0\",\n\"numpy\u003e=1.26.4\",\n\"scikit-learn\u003e=1.4.2\",\n\"scipy\u003e=1.13.1\",\n\"pyyaml\u003e=6.0\",\n\"matplotlib\u003e=3.8.4\",\n\"argparse\u003e=1.4.0\",\n\"h5py\"\n```\n\n### For LLNL LC Lassen users\n\nThe work-in-progress python package is compatiable with [OpenCE-1.9.1](https://lc.llnl.gov/confluence/pages/viewpage.action?pageId=785286611).\nFor installing GPLasDI on opence environment:\n```\nsource /your/anaconda\nconda activate /your/opence/environment\n\nconda install scikit-learn\npip install argparse\n\npip install .\n```\n\n## Examples\n\n\u003c!-- Four examples are provided, including --\u003e\n\n* 1D Burgers Equation\n\nThe example of Burgers 1D equation can be run:\n```\ncd examples\nlasdi burgers1d.yml\n```\nPost-processing \u0026 visualization of the Burgers 1D equation can be seen in the jupyter notebook `examples/burgers1d.ipynb`.\n\n**TODO** Support offline physics wrapper and Burgers 2D equation\n\n* ~~2D Burgers Equation~~\n* ~~1D1V Vlasov Equation~~\n* ~~Rising Heat Bubble (Convection-Diffusion Equation)~~\n\nTo run the Vlasov equation and rising bubble example, [HyPar](http://hypar.github.io/) also needs to be installed. It can be download and compiled by running:\n```\ngit clone https://bitbucket.org/deboghosh/hypar.git\nautoreconf -i\n[CFLAGS=\"...\"] [CXXFLAGS=\"...\"] ./configure [options]\nmake\nmake install\n```\n\n## Code Description\n\nCore routines and classes are implemented in `src/lasdi` directory:\n\n* `latent_dynamics/__init__.py`: general latent dynamics class that calibrates coefficients and predicts the latent trajectories.\n  * `sindy.py`: strong SINDy class\n* `physics/__init__.py`: general physics class that computes full-order model trajectories based on parameters.\n  * `burgers1d.py`: Burgers1D physics equation solver (run online in python framework)\n* `latent_space.py`: classes for autoencoders. Currently only vanilla multi-layer perceptron is provided.\n* `param.py`: parameter space class that handles train/test parameter points.\n* `gp.py`: base routines for Gaussian-process calibration and sample generation.\n* `gplasdi.py`: GP-based greedy sampler class.\n* `workflow.py`: controls the overall workflow of the executable `lasdi`.\n* `postprocess.py`: miscellaneous post-processing and plotting routines.\n* `inputs.py`: input parser class\n* `fd.py`: library of high-order finite-difference stencils.\n* `timing.py`: light-weight timer class\n\n\u003c!-- * Initial training and test data can be generated by running ```generate_data.py``` in each example directory.\n* GPLaSDI models can be trained by running the file ```train_model1.py``` in each example directory.\n* ```train_model1.py``` defines a **torch** autoencoder class and loads the training data and all the relevant training parameters into a ```model_parameter``` dictionnary. A ```BayesianGLaSDI``` object is created and takes into input the autoencoder and ```model_parameter```. GPLaSDI is trained by running ```BayesianGLaSDI(autoencoder, model_parameters).train()```\n* ```train_framework.py``` defines the ```BayesianGLaSDI``` class, which contains the main iteration loop.\n* ```utils.py``` contains FOM solvers (for the 1D/2D Burgers equations) and all the relevant functions to compute the SINDy coefficients, compute the SINDy loss, generate the GPs training datasets and train the GPs, generate ODE sample sets for new parameters, integrate the sets of ODEs, and compute the maximum variance accross the parameter space for FOM sampling. All the function in ```utils.py``` are being called in the main iteration loop in the ```BayesianGLaSDI``` class. For the 1D1V Vlasov equation and rising bubble examples, ```utils.py``` doesn't explicitly exist but the functions are instead defined in ```utils/utils_sindy.py```\n* ```evaluate_model.py``` and/or ```compute_errors.py``` can be run to plot model predictions and compute relative errors between the ROM and FOM solutions\n\n* For the 1D1V Vlasov equation and rising bubble examples, additional files are being runned within the training loop:\n  * ```solver.py``` contains all the python functions to run **HyPar**. **HyPar** is a finite difference PDE solver written in C. ```init.c``` must be compiled before running GPLaSDI for the first time, using ```gcc init.c -o INIT```. ```INIT``` loads input parameter files written by ```solver.py/write_files``` and convert them into **HyPar**-readable format. Then, ```solver.py/run_hypar``` and ```solver.py/post_process_data``` run **HyPar** and convert FOM solutions into numpy arrays.\n  * In the rising bubble example, an additional C file, ```PostProcess.c``` needs to be compiled before running GPLaSDI for the first time, using ```gcc PostProcess.c -o PP``` --\u003e\n \n## Citation\n[Bonneville, C., Choi, Y., Ghosh, D., \u0026 Belof, J. L. (2023). GPLaSDI: Gaussian Process-based Interpretable Latent Space Dynamics Identification through Deep Autoencoder. arXiv preprint.]()\n\n## Acknowledgement\nY. Choi was supported for this work by the CHaRMNET Mathematical Multifaceted Integrated Capability Center (MMICC).\n\n## Licence\nGPLaSDI is distributed under the terms of the MIT license. All new contributions must be made under the MIT. See\n[LICENSE-MIT](https://github.com/LLNL/libROM/blob/master/LICENSE-MIT)\n\nLLNL Release Nubmer: LLNL-CODE-850536\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fgplasdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllnl%2Fgplasdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fgplasdi/lists"}