pybop.costs.design_cost#

Classes#

DesignCost

Base design cost.

Module Contents#

class pybop.costs.design_cost.DesignCost(target: str)[source]#

Bases: pybop.costs.base_cost.BaseCost

Base design cost.

Note that design costs are maximised by default. Change to minimising by setting the attribute minimising=True.

Parameters:

target (str) – The name of the target variable.

compute(y: dict, dy: numpy.ndarray | None = None) float[source]#

Returns the value of the cost variable.

Parameters:
  • y (dict) – The dictionary of predictions with keys designating the output variables for fitting.

  • dy (np.ndarray, optional) – The corresponding gradient with respect to the parameters for each output variable. Note: not used in design optimisation classes.

Returns:

The value of the output variable.

Return type:

float

verify_prediction(y: dict)[source]#

Verify that the prediction matches the target data.

Parameters:

y (dict) – A dictionary of predictions with keys designating the output variables for fitting.

Returns:

True if the prediction matches the target data, otherwise False.

Return type:

bool

domain = 'Time [s]'[source]#
minimising = False[source]#
target[source]#