Skip to content
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

IncrementalSearch edge cases #373

Merged
merged 4 commits into from
Oct 15, 2018

Conversation

TomAugspurger
Copy link
Member

A couple issues when given a small grid.

For the first, we decided that training 0 models was best, as inverse(next_time_step) was 0.

For the second, we got stuck in an infinite while True loop since

  1. inverse(current_time_step) == inverse(next_time_step) was always equal (both were 0), and
  2. next_time_step is increasing.

We could detect this and raise when something like start < current_time_step + 1, but ideally we would support this. I'm not sure that my fix is correct though.

next_time_step += 1
if inverse(current_time_step) == 0:
# we'll never get out of here
next_time_step = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the inverse function itself should never produce non-positive values? I can imagine placing the min(1, there instead, or perhaps using math.ceil rather than int

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this additional if check is still necessary, even if we change inverse to be always positive. When these start off at the same value (whether it's 0 or 1), we get stuck in a cycle where next_time_step is increasing, making the inverse(current_time_step) == inverse(next_time_step) condition even more false.

@TomAugspurger TomAugspurger merged commit deb7b5f into dask:master Oct 15, 2018
@TomAugspurger TomAugspurger deleted the incremental-small branch October 15, 2018 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants