gemseo / algos

opt_result module

Optimization result

class gemseo.algos.opt_result.OptimizationResult(x_0=None, x_opt=None, f_opt=None, status=None, constraints_values=None, constraints_grad=None, optimizer_name=None, message=None, n_obj_call=None, n_grad_call=None, n_constr_call=None, is_feasible=False)[source]

Bases: object

Stores optimization results

Initialize optimization results

  • x_0 – initial guess for design variables

  • x_opt – optimal design variables values

  • f_opt – the objective function values at optimum

  • status – the optimizer status

  • message – the optimizer message

  • n_obj_call – number of call to objective function by optimizer

  • n_grad_call – number of call to gradient function by optimizer

  • n_constr_call – number of call to constraints function by optimizer

  • is_feasible – True if the solution is feasible, false else

DICT_REPR_ATTR = ['x_0', 'x_opt', 'optimizer_name', 'message', 'f_opt', 'status', 'n_obj_call', 'n_grad_call', 'n_constr_call', 'is_feasible']
HDF_CSTR_GRAD_KEY = 'constr_grad:'
HDF_CSTR_KEY = 'constr:'

Returns a dict representation of self for serialization functions are removed


a dict with attributes names as keys

static init_from_dict_repr(**kwargs)[source]

Initalizes a new opt result from a data dict typically uised for deserialization


kwargs – key value pairs from DICT_REPR_ATTR


Logs the self.__repr__ message