Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An attempt to fix the current CMAES inconsistencies #351
An attempt to fix the current CMAES inconsistencies #351
Changes from 2 commits
670ebb2
f28fd18
39feebb
4a42820
21e2e89
43f5146
5a00748
ac10206
d42f985
c88e0c3
46565e7
716cea6
e2e9065
26c1a23
b49b03d
1c4a4db
5623d04
a6fb391
b791390
8a4e2e6
8ea9d06
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor style fix: wrapped lines should be doubly indented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also worth pointing out is that you call
transformationPolicy.Transform()
twice here for each inner iteration of the loop. Does it perhaps make more sense to callTransform()
once, before the loop? That may require some further refactoring, but it seems to me to be conceptually simpler to simply useTransform()
to map each new proposed iterate back into the required range right after a step is taken, only once.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh yes! Sorry and thank you for pointing this out! I will fix this very soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would make the update steps depend on the transformation policy, which isn't really my intention here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the goal is the compute
C^{-1/2}
, it should suffice to useinv(covLower)
: https://math.stackexchange.com/questions/1230051/inverse-square-root-of-matrixI think Armadillo will solve the system more quickly too if you specify
trimatl()
(since it is a lower triangular matrix):inv(trimatl(covLower))
.I haven't checked this exactly, but it should at least be in the right direction. You should verify my comment here instead of trusting it to be correct... 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Nikolaus Hansen's The CMA Evolution Strategy: A Tutorial
C^{-1/2}
is defined to beB * D^{-1} * B^T
which isn't always equal to the inverse ofcovLower = B * D^{1/2}
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern here really comes from the fact that we are computing both the Cholesky decomposition and the eigendecomposition. I'd prefer to use one or the other, because these tend to be expensive operations. However, I haven't worked out the math to either (a) express
C^{-1/2}
in terms of the Cholesky decomposition or (b) express the earlier operations that usecovLower
in terms of the eigendecomposition.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand and agree. I haven't had much time to think about this either but I'll try to figure something out soon.