-
Notifications
You must be signed in to change notification settings - Fork 356
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
Bounded numerical value with shifted prior #361
Comments
Hi,
I think constraints will be the way to go in the future, but for now it's still experimental and barely documented... In practice I do find that the current implementation completely misses the point of being easy to use, I'm currently working on a huge refactor of the instrumentation #323 which will hopefully come with a simpler API (and a lot more of abilities). If you have ideas of how you would like to be able to specify your prior, let me know, I'm looking for ideas ;) |
Thank you @jrapin , I looked at After I had a chance to think about it one more time, it seems that doing
should do what I am aiming at. The values of For instance, if I want to prioritise value
|
I still find that having to come up with such an equation is cumbersome :D |
Thank you, I like the idea of setting the initial value and sigma. It sounds like a robust approach of mapping between the internal space and user argument. I don't know exactly why this happens, but this is why I decided not to use the |
I would expect this since the width of your space is smaller than let's say 5 sigma (by default the standard deviation of the mutation is basically 1, if you don't use "affined") ng.var.Scalar().affined(0.1, 100.5).bounded(100, 101, transform="clipping") would do what you want: s.data_to_arguments([-3])
>>> ((100.2,), {}) As you can see, it's not so intuitive, happy that you like the new approach idea. In this future approach, you would have to write: ng.var.Scalar(100.5).set_mutation(sigma=0.1).set_bounds(100, 101) It's the same exact same numbers in the end, but probably more explicit. And that will come with a whole bunch of powerful features :D |
Sounds great, thank you @jrapin . Just one more thing to mention: how would you expect this to work? Should it still be alright, considering the bias is not centralised relatively to the bounds? ng.var.Scalar(100.01).set_mutation(sigma=0.1).set_bounds(100, 101) |
it should work somehow, but many points will be similar at the bounds from the start, so it may be dangerous depending on what you want. ng.var.Scalar(100.01).set_mutation(sigma=0.1).set_bounds(100, 101, method="constraint") |
From #391 the following should now work: ng.p.Scalar(100.01).set_mutation(sigma=0.1).set_bounds(100, 101, method="constraint") (notice this is the new scalar class in |
I am exploring a possibility to implement a simple instrumentation with the following functionality. We create a bounded
Scalar
variable, which default is within the bounds but not centralised between the bounds. Would that be possible to do?Steps to reproduce
Observed Results
The resulting
args, kwargs
are((0.057249147048700155,), {})
, which is not directly related to theaffined
transformation.Expected Results
The expected result would be
((-0.5,), {})
, although the current implementation is definitely doing what it is suppose to be doing.Question
What is the preferred way to have a "shifted" bounded
Scalar
variable in nevergrad? It has been mentioned in the doc file but without an example code.The text was updated successfully, but these errors were encountered: