54 void set(
const vector<Index>& feature_dimensions,
const vector<Descriptives>&
descriptives);
57 void bound(
const vector<Index>& feature_dimensions,
const vector<Condition>& conditions);
62 const MatrixR& subset_optimal_points,
63 const vector<Index>& input_feature_dimensions,
64 const vector<VariableType>& input_variable_types);
128 const Domain& output_domain)
const;
132 const MatrixR& feasible_outputs,
159 vector<Condition> conditions;
161 Index evaluations_number = 2000;
163 Index max_iterations = 10;
165 Index min_iterations = 4;
167 float zoom_factor = 0.45f;
169 float relative_tolerance = 0.001f;
Abstract base class for OpenNN datasets, owning samples, variables, and metadata.
Definition dataset.h:61
Container of layers forming a feed-forward neural network, with parameter storage and I/O.
Definition neural_network.h:20
Domain get_original_domain(const string role) const
Returns the original (untrimmed) domain for variables playing the given role.
pair< MatrixR, MatrixR > calculate_optimal_points(const MatrixR &feasible_inputs, const MatrixR &feasible_outputs, const Objectives &objectives) const
Selects the optimal points among feasible candidates according to the supplied objectives.
MatrixR perform_response_optimization() const
Runs the response optimization using the configured conditions and returns the optimal results.
MatrixR assemble_results(const MatrixR &inputs, const MatrixR &outputs) const
Assembles the final results matrix concatenating inputs and outputs.
MatrixR perform_multiobjective_optimization(const Objectives &objectives) const
Performs multiobjective optimization and returns the Pareto-optimal input/output samples.
void set_zoom_factor(float new_zoom_factor)
pair< MatrixR, MatrixR > filter_feasible_points(const MatrixR &inputs, const MatrixR &outputs, const Domain &output_domain) const
Filters the (inputs, outputs) pairs whose outputs fall inside the feasible output domain.
pair< MatrixR, MatrixR > calculate_pareto(const MatrixR &inputs, const MatrixR &outputs, const MatrixR &objective_matrix) const
Computes the Pareto front of the supplied input/output samples.
Objectives build_objectives() const
Builds the Objectives helper from the current conditions.
MatrixR perform_single_objective_optimization(const Objectives &objectives) const
Performs single-objective optimization and returns the best input/output pair.
ConditionType
Types of constraint or objective applied to an input or output variable.
Definition response_optimization.h:27
@ EqualTo
Definition response_optimization.h:27
@ Between
Definition response_optimization.h:27
@ None
Definition response_optimization.h:27
@ Maximize
Definition response_optimization.h:27
@ LessEqualTo
Definition response_optimization.h:27
@ GreaterEqualTo
Definition response_optimization.h:27
@ LessThan
Definition response_optimization.h:27
@ Minimize
Definition response_optimization.h:27
@ GreaterThan
Definition response_optimization.h:27
void set_iterations(const int iterations)
pair< float, float > calculate_quality_metrics(const MatrixR &inputs, const MatrixR &outputs, const Objectives &objectives) const
Computes quality metrics of the optimization (e.g. distance to utopian point).
void set_relative_tolerance(float new_relative_tolerance)
void clear_conditions()
Removes all conditions previously configured on input and output variables.
void set_evaluations_number(const int new_evaluations_number)
void set_condition(const string &name, const ConditionType condition, float low_bound=0.0, float up_bound=0.0)
Adds or replaces the condition applied to the variable with the given name.
ResponseOptimization(NeuralNetwork *=nullptr, Dataset *=nullptr)
Constructs the optimizer bound to an optional neural network and dataset.
vector< float > get_utopian_point() const
Returns the coordinates of the utopian point used as reference for multiobjective optimization.
MatrixR calculate_random_inputs(const Domain &input_domain) const
Draws a random sample of input points within the given input domain.
void set(NeuralNetwork *=nullptr, Dataset *=nullptr)
Binds the optimizer to a neural network and a dataset.
Condition get_condition(const Index index) const
Returns the configured condition at the given index.
Definition adaptive_moment_estimation.h:14
vector< Descriptives > descriptives(const MatrixR &)
Returns the per-column descriptives of a matrix.
Matrix< float, Dynamic, 1 > VectorR
Definition pch.h:181
Matrix< float, Dynamic, Dynamic, Layout > MatrixR
Definition pch.h:177
Constraint or objective imposed on a single variable, with optional bounds.
Definition response_optimization.h:31
Condition(ConditionType new_type=ConditionType::None, float new_low_bound=0.0, float new_up_bound=0.0)
Builds a condition of the given type with the given bounds.
Definition response_optimization.h:37
ConditionType condition
Definition response_optimization.h:32
float low_bound
Definition response_optimization.h:33
float up_bound
Definition response_optimization.h:34
Bounded domain in input or output space defined by inferior and superior frontiers.
Definition response_optimization.h:43
Domain(const vector< Index > &feature_dimensions, const vector< Descriptives > &descriptives)
Builds a domain from feature dimensions and per-feature descriptives.
Definition response_optimization.h:48
VectorR inferior_frontier
Definition response_optimization.h:66
void reshape(const float zoom_factor, const VectorR ¢er, const MatrixR &subset_optimal_points, const vector< Index > &input_feature_dimensions, const vector< VariableType > &input_variable_types)
Zooms and recenters the domain around the supplied optimal points for the next iteration.
void bound(const vector< Index > &feature_dimensions, const vector< Condition > &conditions)
Tightens the frontiers using the supplied per-variable conditions.
void set(const vector< Index > &feature_dimensions, const vector< Descriptives > &descriptives)
Initializes the frontiers from feature dimensions and per-feature descriptives.
virtual ~Domain()=default
VectorR superior_frontier
Definition response_optimization.h:67
Encodes the objectives extracted from the response optimization configuration.
Definition response_optimization.h:72
void normalize(MatrixR &objective_matrix) const
Normalizes the objective matrix in place using the precomputed normalizer.
MatrixR extract(const MatrixR &inputs, const MatrixR &output) const
Extracts the objective values for the given inputs and outputs.
MatrixR objective_normalizer
Definition response_optimization.h:80
MatrixR objective_sources
Definition response_optimization.h:76
MatrixR utopian_and_senses
Definition response_optimization.h:78
Objectives(const ResponseOptimization &response_optimization)
Builds the objective matrices from the parent response optimization.