relentless.optimize.ObjectiveFunctionResult#
- class relentless.optimize.ObjectiveFunctionResult(variables=None, value=None, gradient=None, directory=None)#
Class storing the value and gradient of a
ObjectiveFunction.- Parameters:
variables (
Variableor tuple) – Variables to stash values (defaults toNone).value (float) – The value of the objective function (defaults to
None).gradient (dict) – The gradient of the objective function. Each partial derivative is keyed on the
IndependentVariablewith respect to which it is taken (defaults toNone).directory (
Directory) – Directory holding written output associated with result. Setting a value ofNoneindicates no written output (defaults toNone).
- Raises:
KeyError – If both
variablesandgradientare defined but their keys don’t match.
Methods
save(filename)Save the result as a JSON file.
Attributes
DirectoryDirectory holding written output.The gradient of the objective function, keyed on its design variables.
The value of the evaluated objective function.
Recorded variables of the
ObjectiveFunction.- property gradient#
The gradient of the objective function, keyed on its design variables.
- Type:
- save(filename)#
Save the result as a JSON file.
- Parameters:
filename (str) – The name of the file to save data in.
- property variables#
Recorded variables of the
ObjectiveFunction.- Type: