OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Private Attributes | List of all members
gridsearch Class Reference
Inheritance diagram for gridsearch:
optk::optimiser

Public Member Functions

 gridsearch ()
 
 ~gridsearch ()
 
void clear () override
 
void update_search_space (sspace::sspace_t *space) override
 
sspace::sspace_tconvert_synthetic_ss (sspace::sspace_t *ss, double q)
 
void update_search_space_s (sspace::sspace_t *space, double q)
 
inst::set generate_parameters (int param_id) override
 
void receive_trial_results (int param_id, inst::set params, double value) override
 
- Public Member Functions inherited from optk::optimiser
 optimiser (std::string name)
 
 ~optimiser ()
 
std::string get_name ()
 
void accept (optimisers *o)
 

Private Attributes

__gs::paramm_root
 
bool fst_gen
 
std::vector< sspace::sspace_t * > m_syn_spaces
 

Additional Inherited Members

- Protected Member Functions inherited from optk::optimiser
void add_to_trials (int param_id, inst::node *n)
 
- Protected Attributes inherited from optk::optimiser
std::unordered_map< int, inst::settrials
 

Constructor & Destructor Documentation

◆ gridsearch()

gridsearch::gridsearch ( )

The constructor; simply calls the constructor specified for the optimiser class which this class inherits.

◆ ~gridsearch()

gridsearch::~gridsearch ( )

The destructor; used to recursively free elements stored on the heap.

Member Function Documentation

◆ clear()

void gridsearch::clear ( )
overridevirtual

The overidden clear function for resetting the benchmark.

Reimplemented from optk::optimiser.

◆ convert_synthetic_ss()

sspace::sspace_t * gridsearch::convert_synthetic_ss ( sspace::sspace_t ss,
double  q 
)

Converts the search space for synthetic benchmarks (defined as uniformly distributed variables) into sspace::quniform parameters.

Parameters
ssThe original search space.
qThe quantisation for uniform parameters.
Returns
A search space made up of quniform parameters.

◆ generate_parameters()

inst::set gridsearch::generate_parameters ( int  param_id)
overridevirtual

Returns the next unique parameter configuration.

Parameters
param_idThe identifier which will be matched with the selected parameter combination.

Reimplemented from optk::optimiser.

◆ receive_trial_results()

void gridsearch::receive_trial_results ( int  param_id,
inst::set  params,
double  value 
)
overridevirtual

Stores params if value is greater than previous best.

Parameters
param_idThe identifier of the parameter combination which generated the result.
paramsThe parameters themselves
paramsThe result from the objective function

Reimplemented from optk::optimiser.

◆ update_search_space()

void gridsearch::update_search_space ( sspace::sspace_t space)
overridevirtual

Expands the lists of parameters into a format from which it is easier to generate all possible configurations sequentially.

Parameters
spaceThe search space to unpack. The gridsearch optimiser only accepts parameters of type param::choice, param::categorical, param::randint as well as param::quniform.

Reimplemented from optk::optimiser.

◆ update_search_space_s()

void gridsearch::update_search_space_s ( sspace::sspace_t space,
double  q = 0.2 
)

A convenience method for accepting a search space from a synthetic benchmark. This is equivalent to calling

benchmark.get_search_space(), q
);
Parameters
spaceThe search space returned from synthetic::get_search_space.
qThe quantisation for uniform parameters.

Member Data Documentation

◆ fst_gen

bool gridsearch::fst_gen
private

Indicates whether this is the first call to generate_parameters

◆ m_root

__gs::param* gridsearch::m_root
private

This is a reference to the 'root' of the 'unpacked' (internal) representation of the search space.

◆ m_syn_spaces

std::vector<sspace::sspace_t *> gridsearch::m_syn_spaces
private

A list of pointers to converted synthetic benchmark search spaces allocated through convert_synthetic_ss; used in destructor to avoid memory leaks.


The documentation for this class was generated from the following files: