Skip to content

Commit

Permalink
Serializing population
Browse files Browse the repository at this point in the history
  • Loading branch information
gAldeia committed Nov 7, 2024
1 parent e68be7a commit 10af3c1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,13 @@ class Engine{

Individual<T> best_ind; ///< best individual found during training
Archive<T> archive; ///< pareto front archive
Population<T> pop; ///< population of programs

bool is_fitted; ///< keeps track of whether fit was called
private:

Population<T> pop; ///< population of programs
Selection<T> selector; ///< selection algorithm
Evaluation<T> evaluator; ///< evaluation code
Variation<T> variator; ///< variation operators
Variation<T> variator; ///< variation operators
Selection<T> survivor; ///< survival algorithm

Log_Stats stats; ///< runtime stats
Expand All @@ -159,10 +158,10 @@ class Engine{

// TODO: should I serialize data and search space as well?
// Only stuff to make new predictions should be serialized
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::Regressor>, params, best_ind, archive, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::BinaryClassifier>, params, best_ind, archive, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::MulticlassClassifier>, params, best_ind, archive, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::Representer>, params, best_ind, archive, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::Regressor>, params, best_ind, archive, pop, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::BinaryClassifier>, params, best_ind, archive, pop, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::MulticlassClassifier>, params, best_ind, archive, pop, ss, is_fitted);
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Engine<PT::Representer>, params, best_ind, archive, pop, ss, is_fitted);

} // Brush
#endif

0 comments on commit 10af3c1

Please sign in to comment.