16 #ifndef MLPACK_CORE_OPTIMIZERS_CNE_CNE_HPP 17 #define MLPACK_CORE_OPTIMIZERS_CNE_CNE_HPP 22 namespace optimization {
98 CNE(
const size_t populationSize = 500,
99 const size_t maxGenerations = 5000,
100 const double mutationProb = 0.1,
101 const double mutationSize = 0.02,
102 const double selectPercent = 0.2,
103 const double tolerance = 1e-5,
104 const double objectiveChange = 1e-5);
116 template<
typename DecomposableFunctionType>
117 double Optimize(DecomposableFunctionType&
function, arma::mat& iterate);
173 void Crossover(
const size_t mom,
175 const size_t dropout1,
176 const size_t dropout2);
179 arma::cube population;
182 arma::vec fitnessValues;
188 size_t populationSize;
191 size_t maxGenerations;
200 double selectPercent;
206 double objectiveChange;
219 #include "cne_impl.hpp" double Tolerance() const
Get the final objective value.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double MutationSize() const
Get the mutation size.
Conventional Neural Evolution (CNE) is a class of evolutionary algorithms focused on dealing with fix...
double & Tolerance()
Modify the final objective value.
size_t PopulationSize() const
Get the population size.
size_t & PopulationSize()
Modify the population size.
double & SelectionPercentage()
Modify the selection percentage.
CNE(const size_t populationSize=500, const size_t maxGenerations=5000, const double mutationProb=0.1, const double mutationSize=0.02, const double selectPercent=0.2, const double tolerance=1e-5, const double objectiveChange=1e-5)
Constructor for the CNE optimizer.
double Optimize(DecomposableFunctionType &function, arma::mat &iterate)
Optimize the given function using CNE.
double & MutationProbability()
Modify the mutation probability.
double SelectionPercentage() const
Get the selection percentage.
size_t MaxGenerations() const
Get maximum number of generations.
double & MutationSize()
Modify the mutation size.
double & ObjectiveChange()
Modify the termination criteria of change in fitness value.
size_t & MaxGenerations()
Modify maximum number of generations.
double ObjectiveChange() const
Get the change in fitness history between generations.
double MutationProbability() const
Get the mutation probability.