pulsatrix
Loading...
Searching...
No Matches
hpo_genotype.hpp File Reference

Decodes a real-valued genotype (a unit-hypercube point, one gene per parameter, each in [0, 1]) into a full hyperparameter Configuration – the encoding this campaign's GA operators (crossover.hpp/mutation.hpp, all defined over std::vector<double>) evolve directly, decoded only when a genotype needs to be evaluated. More...

#include <algorithm>
#include <cmath>
#include <stdexcept>
#include <vector>
#include "pulsatrix/search_space.hpp"
Include dependency graph for hpo_genotype.hpp:

Go to the source code of this file.

Namespaces

namespace  pulsatrix
 

Functions

Configuration pulsatrix::DecodeGenotype (const SearchSpace &space, const std::vector< double > &genotype)
 Decodes a unit-hypercube genotype into a Configuration using space's own declared bounds: Continuous linearly, LogUniform geometrically (both identical to gp_bo.hpp's UnitCubeToConfiguration); Integer by linear interpolation then rounding to the nearest integer (std::round – ties away from zero, portable); Categorical by linear interpolation into an index, floored, clamped to the last category (handles the gene == 1.0 boundary, which would otherwise floor to one-past-the-end).
 

Detailed Description

Decodes a real-valued genotype (a unit-hypercube point, one gene per parameter, each in [0, 1]) into a full hyperparameter Configuration – the encoding this campaign's GA operators (crossover.hpp/mutation.hpp, all defined over std::vector<double>) evolve directly, decoded only when a genotype needs to be evaluated.

Note
Reuses the same unit-hypercube convention campaign_exai_dl_library_hyperparameter_optimization's own GP-BO surrogate established (gp_bo.hpp's UnitCubeToConfiguration) for Continuous/LogUniform parameters, but – unlike that function, which deliberately throws on Integer/ Categorical since vanilla GP-BO's kernel cannot handle them – this decoder handles every ParameterKind, since this campaign's own GA operators have no such restriction (crossover/mutation over a real-valued vector composes with Integer and Categorical genes exactly as easily as Continuous ones; only the final decode step differs per kind).