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

BalancingLearner of SequenceLearners does not finish calculation #213

Open
andrenmelo opened this issue Sep 4, 2019 · 5 comments · May be fixed by #214
Open

BalancingLearner of SequenceLearners does not finish calculation #213

andrenmelo opened this issue Sep 4, 2019 · 5 comments · May be fixed by #214

Comments

@andrenmelo
Copy link

The following code fails to finish the calculation

import adaptive
adaptive.notebook_extension()

def dummy(x):
    return x

sequence = range(20)
learners = [adaptive.SequenceLearner(dummy, sequence)]
bl = adaptive.BalancingLearner(learners)
runner = adaptive.Runner(bl, lambda bl: all([l.done() for l in bl.learners]), 
                         log=True)
runner.live_info()

The error is happening in runner._get_futures(). I think something goes wrong when the runner asks for more points then there are points left in sequence.

@andrenmelo
Copy link
Author

The log is just
[('ask', 48)]

@akhmerov
Copy link
Contributor

akhmerov commented Sep 4, 2019

As a temporary workaround you can use a single sequence learner (there's nothing to balance really).

@andrenmelo
Copy link
Author

Oh that was just a minimal example. In reality I have a bunch of sequence learners.

@akhmerov
Copy link
Contributor

akhmerov commented Sep 4, 2019

I mean that also if you have a bunch of sequence learners, you can directly combine and shuffle the sequences. Since all the values are predefined, balancing learner does not bring any advantage as far as I can tell.

@basnijholt
Copy link
Member

It should work with the fix in #214.

I will test a bit more.

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 a pull request may close this issue.

3 participants