Restart capability and offline FOM interface #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Restart capability
The workflow now supports restart capability, saving/loading necessary data to/from a restart file.
export
andload
function, which saves/loads from a dictionary:Autoencoder
ParameterSpace
LatentDynamics
,SINDy
Physics
,Burgers1D
BayesianGLaSDI
Timer
lasdi.workflow.main
function saves/loads all these classes into/from a restart file.Interface to offline FOM simulations
For greedy sampling, new FOM solutions are added to the training data. For offline FOM simulations, the python training needs to be paused, so that FOM simulation runs for new parameter points and saves the solution ready to read from python framework. This is now supported by two workflow stages
NextStep.RunSamples
andNextStep.CollectSamples
.lasdi.workflow.run_samples
['workflow']['offline_greedy_sampling']['train_param_file']
['workflow']['offline_greedy_sampling']['test_param_file']
lasdi.workflow.collect_samples
run_samples
.collect_samples
then reads the solution and appends training/test data.['workflow']['offline_greedy_sampling']['train_sol_file']
['workflow']['offline_greedy_sampling']['test_sol_file']
h5py
package is used to use hdf5 format, which can be well accessed from most of programming languages (supposedly).Offline FOM wrapper and offline driver for Burgers 1D equation
lasdi.physics.OfflineFOM
provides a wrapper for offline FOM simulation. It does not solve/run any simulation, rather only specifies spatial/time grid size and solution dimension.burgers1d
provides a offline, command-line driver for Burgers 1D equation. It reads input options from a yaml file. In essence, it provides the offline FOM part that connects to the interface described above.Factorizing training and greedy sampling stages
BayesianGLaSDI.train
performs both training and greedy sampling. This is now separated intotrain
andget_new_sample_point
.lasdi.workflow.pick_samples
runsBayesianGLaSDI.get_new_sample_point
and append the parameter training space.NextStep.Train
andNextStep.PickSamples
.Prerequisites addition
h5py
package is required for saving/loading parameters and FOM solutions.Full workflow demonstration of Burgers 1d example
examples/burgers1d.ipynb
now also include data generation/training stages, as well as post processing.examples/burgers1d.offline.bash
also demonstrates the entire workflow with offline FOM solver.Variable name changes in
BayesianGLaSDI
classn_iter
->max_iter
: maximum iteration for the entire workflown_greedy
->n_iter
: number of iteration for onetrain
routine. This is also the frequency of greedy sampling.max_greedy_iter
remains the same.