-
Notifications
You must be signed in to change notification settings - Fork 59
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
What should learners do when fed the same point twice #39
Comments
originally posted by Jorn Hoofwijk (@Jorn) at 2018-09-17T18:26:22.524Z on GitLab I think it is indeed best practice to just raise an exception, as we should not allow this to happen. If for some reason I cannot think of, we would need to silently ignore it we could set some variable so you would then create a learner by: learner = LearnerND(func, bounds=[(-1,1),(-1,1)]) # for normal behaviour)
learner = LearnerND(func, bounds=[(-1,1),(-1,1)], strict=False) # for allowing a user to add the same point twice, for whatever reason they would want this |
originally posted by Anton Akhmerov (@anton-akhmerov) at 2018-09-24T19:22:39.053Z on GitLab ignore or overwrite? |
originally posted by Bas Nijholt (@basnijholt) at 2018-12-07T19:44:56.320Z on GitLab We have decided that we should do the following: def tell(self, x, y):
if x in self.data:
# The point is already evaluated before
return
# Add point to the data dict
self.data[x] = y
# remove from set of pending points
self.pending_points.discard(x)
if not self.bounds[0] <= x <= self.bounds[1]:
# if outside of the domain, stop.
return
update_the_other_data_structure_such_as_loss(...) This is implemented in all the learners ATM. |
(original issue on GitLab)
opened by Joseph Weston (@jbweston) at 2018-09-17T14:44:24.594Z
This is what we do for LearnerND (and I think Learner2D also, but I'm not sure).
Does this make sense? In what cases would someone call
tell
if the point was already evaluated? Would it make more sense to raise an exception because this indicates an error?If I say
I would either expect:
The text was updated successfully, but these errors were encountered: