-
Notifications
You must be signed in to change notification settings - Fork 123
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
Recursively check for Evaluate() in MOO #283
Conversation
I think template specialization is the only way out of it. Thoughts? @zoq |
I don't mind the solution, I think it's fine; it would also be fine for me to change the order, it's an internal function so we will not break anything. @rcurtin what do you think? |
I found two solutions for the problem, one is: for(....)
{
using FunctionType = typename std::tuple_element<
I, std::tuple<ArbitraryFunctionType...>>::type;
traits::CheckArbitraryFunctionTypeAPI<
FunctionType, MatType>();
....
}
OR Just take all the arguments, and keep the MatType as separate (as is implemented in the current PR). |
a) static_check (possibly wrong) b) check Arbitrary in for loop in EvaluateObjectives
- doc change for MOO trait
Perfect! Side Note: Static Code Analysis is falling because "it can't find cmake". I don't think it has anything to do with the code itself (I may be wrong). |
@mlpack-jenkins test this please |
Co-authored-by: Marcus Edel <marcus.edel@fu-berlin.de>
Trying this on NSGA2 is giving me some errors, I'll fix it and ping you back. Note: The issue is fixed. Thanks to that error, the code is even better. ping: @zoq |
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.
Would be nice if you could add a MMO function to:
https://github.com/mlpack/ensmallen/blob/master/tests/function_test.cpp
Nevermind, it's another test suite. |
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 putting this together 👍
@mlpack-jenkins test this please |
@zoq I suppose I need to rebase ? |
No, I just like to see if the |
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. 👍
mlpack master build fails: g.Component(0).Mean()[0] == Approx(0.5).epsilon(0.05)
FAILED:
REQUIRE( g.Component(0).Mean()[0] == Approx(0.5).epsilon(0.05) )
with expansion:
0.5299031563 == Approx( 0.5 )
at /home/jenkins/workspace/pull-requests-ensmallen-mlpack-build/mlpack/src/mlpack/tests/gmm_test.cpp:276 Is this expected? |
Some mlpack tests are non-deterministic, so they can fail sometimes, in most cases a simple threshold adjustment is all what is needed. |
Thanks again for the contribution. |
Refer #282 Section II.
Is there a strong reason for having
template<MatType, FunctionType>
instead oftemplate<FunctionType, MatType>
, the problem is when we do recursive call, I need the FunctionType to be the at the end for it to work. I don't see any other way.Infact if we go by
template<MatType, FunctionType>
, I can integrateCheckMultiArbitraryFunctionTypeAPI()
intoCheckArbitraryFunctionTypeAPI()
, and it will work like normal + MOO checks.