surrogate_model.py

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

class openmdao.surrogate_models.surrogate_model.MultiFiSurrogateModel[source]

Bases: openmdao.surrogate_models.surrogate_model.SurrogateModel

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

__init__()

Initialize all attributes.

linearize(x)

Calculate the jacobian of the interpolant at the requested point.

Parameters:

x : array-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:

x : array-like

Point(s) at which the surrogate is evaluated.

train(x, y)[source]

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

Parameters:

x : array-like

Point(s) at which the surrogate is evaluated.

y : array-like

Model responses at given inputs.

train_multifi(x, y)[source]

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

Parameters:

x : list of (m samples, n inputs) ndarrays

Values representing the multi-fidelity training case inputs.

y : list of ndarray

output training values which corresponds to the multi-fidelity training case input given by x.

vectorized_predict(x)

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

Parameters:

x : array-like

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

class openmdao.surrogate_models.surrogate_model.SurrogateModel[source]

Bases: object

Base class for surrogate models.

Attributes

trained (bool) True when surrogate has been trained.
__init__()[source]

Initialize all attributes.

linearize(x)[source]

Calculate the jacobian of the interpolant at the requested point.

Parameters:

x : array-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:

x : array-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:

x : array-like

Training input locations

y : array-like

Model responses at given inputs.

vectorized_predict(x)[source]

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

Parameters:

x : array-like

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