-
Notifications
You must be signed in to change notification settings - Fork 119
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
Make Callback flexible for MultiObjective Optimizers. #289
Conversation
=> add MOOTypedForms in traits.hpp. => added a specialization for StepTaken for MOO in callbacks.hpp.
@zoq Similar to |
2. rename to ObjectivesVecType
The current implementation doesn't throw compile errors, but it doesn't work either. Looks like a template matching issue. |
To test its working, I created this test code. This is working completely fine given I have defined This should be defined first template<typename OptimizerType,
typename FunctionType,
typename ObjectivesVecType,
typename IndicesType,
typename MatType,
typename ...CallbackTypes>
static bool StepTaken(OptimizerType& optimizer,
FunctionType& functions,
MatType& coordinates,
ObjectivesVecType& objectives,
IndicesType& frontIndices,
CallbackTypes&... callbacks) and after that template<typename OptimizerType,
typename FunctionType,
typename MatType,
typename... CallbackTypes>
static bool StepTaken(..) So that the compiler avoids going into the usual StepTaken function. Let me know if this is fine or should I rename the first one as |
This looks fine to me. |
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.
Can you update https://github.com/mlpack/ensmallen/blob/master/tests/callbacks_test.cpp as well, the test you posted is a good basis.
Gotta update the docs as well. |
=> Move Callback::StepTaken() at the end of for loop nsga2 => Register GenerationStepTaken in macro
GTM? @zoq |
Co-authored-by: Marcus Edel <marcus.edel@fu-berlin.de>
Looks like this is ready |
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.
Looks great to me, thanks for doing that.
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. 👍
Thanks for another great addition. |
Related to #282
MOOTypedForms
struct specifically for MOO related type forms.GenerationalStepTaken
, replacement for StepTaken in MOO.@zoq Let me know if you agree with this methodology. You can check the commit message to see what I've done.