|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
Defines the main types used in the program. More...
#include <cstdlib>#include <cmath>#include <memory>#include <random>#include <stdexcept>#include <string>#include <tuple>#include <vector>#include <unordered_map>#include <sys/types.h>Go to the source code of this file.
Classes | |
| struct | optk::ctx_t |
| class | inst::param |
| class | inst::int_val |
| class | inst::dbl_val |
| class | inst::str_val |
| class | inst::node |
| class | sspace::param_t |
| class | sspace::categorical< T > |
| class | sspace::choice |
| class | sspace::randint |
| class | sspace::uniform |
| class | sspace::quniform |
| class | sspace::loguniform |
| class | sspace::qloguniform |
| class | sspace::normal |
| class | sspace::qnormal |
| class | sspace::lognormal |
| class | sspace::qlognormal |
Namespaces | |
| inst | |
Macros | |
| #define | GETINT(dest, src, key) inst::int_val *dest = static_cast<inst::int_val *>((src)->get_item (key)) |
| #define | GETDBL(dest, src, key) inst::dbl_val *dest = static_cast<inst::dbl_val *>((src)->get_item (key)) |
| #define | GETSTR(dest, src, key) inst::str_val *dest = static_cast<inst::str_val *>((src)->get_item (key)) |
| #define | GETNODE(dest, src, key) inst::node *dest = static_cast<inst::node *>((src)->get_item (key)) |
Typedefs | |
| typedef node * | inst::set |
| typedef std::unordered_map< std::string, param * > | inst::value_map |
| typedef std::vector< param_t * > | sspace::sspace_t |
Enumerations | |
| enum | inst::inst_t : char { inst::inst_t::node, inst::inst_t::int_val, inst::inst_t::dbl_val, inst::inst_t::str_val } |
| enum | pt : char { pt::categorical_int, pt::categorical_dbl, pt::categorical_str, pt::choice, pt::randint, pt::uniform, pt::quniform, pt::loguniform, pt::qloguniform, pt::normal, pt::qnormal, pt::lognormal, pt::qlognormal } |
Functions | |
| template<class T > | |
| T | inst::get (node *n, const std::string &k) |
| void | inst::free_node (node *n) |
| void | sspace::validate_param_values (inst::value_map *vals, sspace::sspace_t *sspace) |
| void | sspace::free_ss (sspace_t *ss) |
Defines the main types used in the program.
Copyright (C) 2020 Maxime Robeyns maximerobeyns@gmail.com
Written for the ACRC, University of Bristol
Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.osedu.org/licenses/ECL-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LIcense For The Specific Language Governing permissions and limitations under the License.
| typedef std::vector<param_t *> sspace::sspace_t |
sspace_t represents the search space or parameter space in which the parameters must be optimised.
|
strong |
pt ('param type') enumerates the types available for defining a parameter space, and is compatible with NNI.
| void sspace::free_ss | ( | sspace::sspace_t * | ss | ) |
A convenience method to delete a search space description which was allocated on the heap. This function is often used in class destructors.
| ss | The heap-allocated search space description to free. |
| void sspace::validate_param_values | ( | inst::value_map * | vals, |
| sspace::sspace_t * | sspace | ||
| ) |
This function takes a set of concrete parameters, and the corresponding description of the parameter space, and ensures that each concrete value is a valid instance of the description.
| vals | The set of concrete values; this usually comes from the optimisation algorithm. |
| sspace | The description of the search space |
| std::invalid_argument | This is thrown when a discrepency between an instance of a parameter and its description is detected. |
1.8.13