Skip to content

Commit

Permalink
avoid infinite loop for single-precision matrices (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
conradsnicta authored Nov 17, 2021
1 parent 525dd6d commit d811ff9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* Accelerate SGD test time
([#330](https://github.com/mlpack/ensmallen/pull/300)).

* Fix potential infinite loop in CMAES
([#331](https://github.com/mlpack/ensmallen/pull/331)).


### ensmallen 2.18.0: "Fairmount Bagel"
###### 2021-10-20
* Add gradient value clipping and gradient norm scaling callback
Expand Down
2 changes: 1 addition & 1 deletion include/ensmallen_bits/cmaes/cmaes_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ typename MatType::elem_type CMAES<SelectionPolicyType>::Optimize(
// add a small value and try again.
BaseMatType covLower;
while (!arma::chol(covLower, C[idx0], "lower"))
C[idx0].diag() += 1e-16;
C[idx0].diag() += std::numeric_limits<ElemType>::epsilon();

for (size_t j = 0; j < lambda; ++j)
{
Expand Down

0 comments on commit d811ff9

Please sign in to comment.