mlpack / ensmallen

A header-only C++ library for numerical optimization --

Home Page:http://ensmallen.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initial population generation in CNE

philipp-andelfinger opened this issue · comments

CNE seems to generate the initial population by adding uniform noise to the initial guess, instead of Gaussian noise as stated in the comment.

https://github.com/mlpack/ensmallen/blob/master/include/ensmallen_bits/cne/cne_impl.hpp#L91

// Generate the population based on a Gaussian distribution around the given
// starting point.
std::vector<BaseMatType> population;
for (size_t i = 0 ; i < populationSize; ++i)
{
  population.push_back(arma::randu<BaseMatType>(iterate.n_rows, iterate.n_cols) + iterate);
}

Possibly, the intended loop body is something like:

population.push_back(mutationSize * arma::randn<BaseMatType>(iterate.n_rows, iterate.n_cols) + iterate);

Nice catch, I'll open a PR to fix this unless you already have a patch ready.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍

I opened #258 with a quick fix. 👍