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
Callbacks #119
Callbacks #119
Conversation
Hard to do with such crazy template metaprogramming...
Also fix memory handling bug.
Needs Armadillo sparse vectorise() support next.
If the BBSGD tests are failing and don't seem to be a part of this PR, we can open a separate issue for that. No need to hold this up on those; let me know what you think. 👍 |
tests/pso_test.cpp
Outdated
double finalValue = f.Evaluate(coords); | ||
REQUIRE(finalValue <= 1e-5); | ||
for (size_t j = 0; j < 4; ++j) | ||
REQUIRE(coords[j] <= 1e-3); |
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 recommend using the element accessor with bounds check here and in other code like this, ie. coords(j)
instead of coords[j]
.
Since this is a test case, we should catch all possible errors. Using []
allows some errors to slip through.
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.
Ah, good point. I did a little regex-ery and here's a patch we can apply to this branch that makes this change for all tests:
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.
Great, will apply the patch.
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 is a huge PR but from my view I think everything is ready. Once this is merged, I'll go ahead and release ensmallen 2.10.0.
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.
Second approval provided automatically after 24 hours. 👍
Signed-off-by: Marcus Edel <marcus.edel@fu-berlin.de>
This is based on #113; see #49 for more details.