You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When finding the minimum x that fulfill a specific constraint: if this last constraint is defined as a lambda function, the following warning is thrown:
[...].venv/lib/python3.8/site-packages/nevergrad/parametrization/core.py:291: UserWarning: Lambda as constraint is not advised because it may not be picklable.
warnings.warn("Lambda as constraint is not advised because it may not be picklable.")
However, as specified in the documentation, I should be able to use a lambda function for constraining my optimization.
I need more information on that, to know if this is a bug or am I misusing NGOpt.
By the way, note that "register_cheap_constraint" is useful only when the objective function is computationally much more expensive that the constraints. Otherwise the other tool is "constraint_violation". In most applications I use "constraint_violation", but "register_cheap_constraint" is better when the objective function is very expensive and/or does not work when constraints are violated. Reopen the issue or post in https://www.facebook.com/groups/nevergradusers if you need help with constraints, I know that we have not enough doc and users suffer a bit with that.
Steps to reproduce
When finding the minimum
x
that fulfill a specific constraint: if this last constraint is defined as a lambda function, the following warning is thrown:Therefore, I replaced my lambda definition:
...by a function definition...
However, as specified in the documentation, I should be able to use a lambda function for constraining my optimization.
I need more information on that, to know if this is a bug or am I misusing NGOpt.
Observed Results
When the lambda definition is replaced by a function definition. No warnings are thrown.
Expected Results
No warnings thrown as in the documentation.
Relevant Code
The text was updated successfully, but these errors were encountered: