|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <optimiser.hpp>
Public Member Functions | |
| optimiser (std::string name) | |
| ~optimiser () | |
| virtual void | clear () |
| std::string | get_name () |
| virtual void | update_search_space (sspace::sspace_t *space) |
| virtual inst::set | generate_parameters (int param_id) |
| virtual void | receive_trial_results (int param_id, inst::set params, double value) |
| void | accept (optimisers *o) |
Protected Member Functions | |
| void | add_to_trials (int param_id, inst::node *n) |
Protected Attributes | |
| std::unordered_map< int, inst::set > | trials |
Private Attributes | |
| std::string | m_name |
| uint | stepidx |
| double | best_val |
| inst::set * | best_params |
This is the base class that every optimisation algorithm will inherit.
| optk::optimiser::optimiser | ( | std::string | name | ) |
The constructor
| name | The identifiying name of this optimisation algorithm. |
| optk::optimiser::~optimiser | ( | ) |
The destructor will free any generated parameter instances not freed by explicit calls to receive_trial_results.
| void optk::optimiser::accept | ( | optimisers * | o | ) |
Uses the visitor pattern to register an optimiser with the optimisers class.
| o | A pointer to the optimisers class with which to register this optimiser. |
|
protected |
This will add a parameter configuration allocated on the heap to the optimiser::trials map, so that it may be freed later by the optimiser's destructor. If a trial configuration already exists with the same param_id, those values will be freed, and the value in the map will be replaced.
| param_id | The identifier for this trial. |
| n | The root node of the concrete parameter settings. |
|
virtual |
Clears / resets this optimiser. This should be the same as calling the destructor and then the constructor.
Reimplemented in gridsearch.
|
inlinevirtual |
This is the method invoked to generate the next trial's parameters for the benchmark or program being optimised.
| param_id | An identifier for this parameter trial; this may or may not be used by the optimistaion algorithm. |
Reimplemented in gridsearch, gp_opt, and random_search.
|
inline |
|
inlinevirtual |
Allows the benchmark or program being optimised to communicate back the value of the cost function for a parameter set.
| param_id | This parameter id is used to identify the parameters used to generate the result. |
| parameters | For increased flexibility, the actual parameters used to generate the result are also copied back. |
| value | The actual value of the objective function. |
Reimplemented in gridsearch, gp_opt, and random_search.
|
inlinevirtual |
This updates the search space defined by the optimiser.
| space | The new search space to use |
Reimplemented in gridsearch, gp_opt, and random_search.
|
private |
The parameters which gave rise to the best_val
|
private |
The best found value of the function
|
private |
The optimisation algorithm's name
|
private |
stepidx is used to generate sequential parameter IDs during step
|
protected |
This is used to keep track of previously generated instances or settings of the parameters, identified by the parameter id passed to the generate_parameters method. Contains elements stored on the heap.
1.8.13