surrogate_model.py

Class definition for SurrogateModel, the base class for all surrogate models.

class openmdao.surrogate_models.surrogate_model.MultiFiSurrogateModel(**kwargs)[source]

Bases: openmdao.surrogate_models.surrogate_model.SurrogateModel

Base class for surrogate models using multi-fidelity training data.

Parameters
**kwargsdict

Options dictionary.

__init__(**kwargs)

Initialize all attributes.

linearize(x)

Calculate the jacobian of the interpolant at the requested point.

Parameters
xarray-like

Point at which the surrogate Jacobian is evaluated.

predict(x)

Calculate a predicted value of the response based on the current trained model.

Parameters
xarray-like

Point(s) at which the surrogate is evaluated.

train(x, y)[source]

Train the surrogate model with the given set of inputs and outputs.

Parameters
xarray-like

Point(s) at which the surrogate is evaluated.

yarray-like

Model responses at given inputs.

train_multifi(x, y)[source]

Train the surrogate model, based on the given multi-fidelity training data.

Parameters
xlist of double array_like elements

A list of arrays with the input at which observations were made, from highest fidelity to lowest fidelity. Designs must be nested with X[i] = np.vstack([…, X[i+1]).

ylist of double array_like elements

A list of arrays with the observations of the scalar output to be predicted, from highest fidelity to lowest fidelity.

vectorized_predict(x)

Calculate predicted values of the response based on the current trained model.

Parameters
xarray-like

Vectorized point(s) at which the surrogate is evaluated.

class openmdao.surrogate_models.surrogate_model.SurrogateModel(**kwargs)[source]

Bases: object

Base class for surrogate models.

Parameters
**kwargsdict

Options dictionary.

Attributes
options<OptionsDictionary>

Dictionary with general pyoptsparse options.

trainedbool

True when surrogate has been trained.

__init__(**kwargs)[source]

Initialize all attributes.

linearize(x)[source]

Calculate the jacobian of the interpolant at the requested point.

Parameters
xarray-like

Point at which the surrogate Jacobian is evaluated.

predict(x)[source]

Calculate a predicted value of the response based on the current trained model.

Parameters
xarray-like

Point(s) at which the surrogate is evaluated.

train(x, y)[source]

Train the surrogate model with the given set of inputs and outputs.

Parameters
xarray-like

Training input locations..

yarray-like

Model responses at given inputs.

vectorized_predict(x)[source]

Calculate predicted values of the response based on the current trained model.

Parameters
xarray-like

Vectorized point(s) at which the surrogate is evaluated.