cratepy.optimization.optimizationfunction.OptimizationFunction¶
- class OptimizationFunction(lower_bounds, upper_bounds, init_shot=None, weights=None)[source]¶
Bases:
ABC
Optimization function interface.
- set_norm_bounds(self, norm_min=-1.0, norm_max=1.0)[source]¶
Set optimization parameters normalization bounds.
- norm_opt_function(self, norm_parameters)[source]¶
Wrapper of optimization function with normalized parameters.
- opt_function_seq(self, parameters_seq)[source]¶
Wrapper of optimization function with sequential parameters.
- norm_opt_function_seq(self, parameters_seq)[source]¶
Wrapper of optimization function with norm. sequential parameters.
Constructor.
- Parameters:
lower_bounds (dict) – Optimization parameters (key, str) lower bounds (item, float).
upper_bounds (dict) – Optimization parameters (key, str) upper bounds (item, float).
init_shot (dict, default=None) – Optimization parameters (key, str) initial guess (item, float).
weights (tuple, default=None) – Weights attributed to each data point.
List of Public Methods
Recover optimization parameters from normalized values.
Get optimization parameters lower and upper bounds.
Get optimization parameters initial guess.
Get optimization parameters normalization bounds.
Get optimization parameters names.
Wrapper of optimization function with normalized parameters.
Wrapper of optimization function with norm.
Normalize optimization parameters between min and max values.
Optimization function.
Wrapper of optimization function with sequential parameters.
Set optimization parameters normalization bounds.
Methods
- abstract __init__(lower_bounds, upper_bounds, init_shot=None, weights=None)[source]¶
Constructor.
- Parameters:
lower_bounds (dict) – Optimization parameters (key, str) lower bounds (item, float).
upper_bounds (dict) – Optimization parameters (key, str) upper bounds (item, float).
init_shot (dict, default=None) – Optimization parameters (key, str) initial guess (item, float).
weights (tuple, default=None) – Weights attributed to each data point.
- get_bounds(is_normalized=False)[source]¶
Get optimization parameters lower and upper bounds.
- Parameters:
is_normalized (bool, default=False) – Whether optimization parameters are normalized or not.
- Returns:
lower_bounds (dict) – Optimization parameters (key, str) lower bounds (item, float).
upper_bounds (dict) – Optimization parameters (key, str) upper bounds (item, float).
- get_norm_bounds()[source]¶
Get optimization parameters normalization bounds.
- Returns:
norm_bounds – Normalization bounds (lower, upper) used to perform the normalization of the optimization parameters.
- Return type:
- norm_opt_function(norm_parameters)[source]¶
Wrapper of optimization function with normalized parameters.
- norm_opt_function_seq(parameters_seq)[source]¶
Wrapper of optimization function with norm. sequential parameters.
- normalize(parameters)[source]¶
Normalize optimization parameters between min and max values.
- Parameters:
- Returns:
norm_parameters – Normalized optimization parameters names (key, str) and values (item, float).
- Return type: