-
Notifications
You must be signed in to change notification settings - Fork 206
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
Do not scale the samples by default #284
Conversation
I agree we should document the fact the If we imagine a sampling method not following that pattern, maybe it means that the |
At least I would ensure that sampling methods are able to compute samples outside the [0,1] hypercube. Also I find it confusing that subclasses should overwrite a __call__ method which does have a special meaning in python. In any case, I would prefer the call to a utility method instead of using the template method pattern. (here: scale_to_xlimits) |
Not sure to understand here: do you mean we could ensure that the I prefer to wait for an actual sampling method generating directly in the input space before duplicating Though a bit awkward for sure, the override of |
No, I would allow a sampling method to generate samples where it wants to.
Actually, that is why I proposed this pull request. I am currently working on a sampling method which does create samples in the input space directly. Should I remove _compute then completely? And overwrite |
... or remove the def __call__(self, n):
x = self._compute(n)
return self._scale_to_xlimits(x) |
Personally I find this very dangerous: A developer then has to know that overwriting (also the doctring of _compute states "Returns: The sampling locations in the input space.") The |
In any case I agree the documentation has to be updated. Still I am not fan of the scale_to_xlimits call duplication and a separate utility very specific to sampling methods. Let's introduce an intermediate class, |
I do like this approach. How about |
Yes I have tought about |
See 0581492 |
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.
Excellent!
The __call__ method does scale the result from _compute() by default. This is unexpected and not documented. Also, it does prevent subclasses to generate samples in the input space directly.