src.blocks.ErrorModel module
This module is responsible for training and inference of error models.
It includes one class for the error models. See details in its own documentation.
Contact person: Stefan Riedmaier Creation date: 20.04.2020 Python version: 3.8
- class src.blocks.ErrorModel.ErrorModel(config, domain)
Bases:
objectThis class is responsible for training and inference of error models.
It includes two main methods called “train_models” and “infer_models” that offer different meta-modeling techniques.
Most techniques are included from own external modules. In case of IPMs, two thin wrapper functions are required: train_ipm_model and infer_ipm_model.
See method details in their own documentations.
- static infer_ipm_model(x, model)
This function performs inference using an Interval Predictor Model (IPM).
It uses the PyIPM package.
- Parameters:
x (np.ndarray) – inputs
model – IPM model
- Return tuple upper_bound, lower_bound:
upper and lower interval boundaries
- infer_models(scenarios_da)
This function uses the trained error model to infer errors in the application domain for new scenarios.
- Parameters:
scenarios_da – data array of scenarios
- Returns:
- static train_ipm_model(x, y, degree)
This function trains an Interval Predictor Model (IPM).
It uses the PyIPM package. The theory can be found, e.g., in [1] and [2].
Literature: [1] E Patelli, M Broggi, S Tolo, J Sadeghi, Cossan Software: A Multidisciplinary And Collaborative Software For Uncertainty Quantification, UNCECOMP 2017, At Rhodes Island, Greece, 2nd ECCOMAS Thematic Conference on Uncertainty Quantification in Computational Sciences and Engineering, June 2017. [2] L. G. Crespo, S. P. Kenny, D. P. Giesy, Y, R. B. Norman and S. R. Blattnig, „Application of Interval Predictor Models to Space Radiation Shielding,“ in 18th AIAA Non-Deterministic Approaches Conference, AIAA SciTech Forum, 2016.
- Parameters:
x (np.ndarray) – inputs
y (np.ndarray) – outputs
degree (int) – degree of the polynomial
- Returns:
trained interval predictor model
- train_models(space_scenarios_da, metric_da)
This function trains an error model of validation metric results across the scenario space.
- Parameters:
space_scenarios_da (xr.DataArray) – data array of scenarios
metric_da (xr.DataArray) – data array of validation metric results
- Returns: