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

progressbar with tqdm #455

Merged
merged 6 commits into from Jan 20, 2019
Merged

progressbar with tqdm #455

merged 6 commits into from Jan 20, 2019

Conversation

PhilipMay
Copy link
Contributor

I added the progressbar. See #454
It can not be turned off and is on by default.
But I can add this if wanted.

The progressbar also shows the best (lowest loss).

Would be happy for feedback.

Philip

@maxpumperla
Copy link
Contributor

@PhilipMay very cool, thanks for this. don't see a reason not to have it on by default, but it might be good to have a switch to turn it off. I have a lib or two that have hyperopt as dependency and I'm worried that this might clutter the output unfavourably in between other stuff.

btw, how does this look in distributed setup (mongo etc.)?

@PhilipMay
Copy link
Contributor Author

I am working on it. Will tell you when I am done.
The distributed setup (mongo etc.) should work too. I will investigate it.

@maxpumperla
Copy link
Contributor

awesome, looking forward to it.

@PhilipMay
Copy link
Contributor Author

PhilipMay commented Jan 15, 2019

I have a lib or two that have hyperopt as dependency and I'm worried that this might clutter the output unfavourably in between other stuff.

@maxpumperla I added a redirect that will avoid this type of clutter. See here: 63a44e5

All your normal printoutput will not break the progressbar. The progressbar will always stay on the bottom. The text will look like scrolling on top of the progressbar. But never below or beneath.

The Progressbar also shows the best (minimum) loss it has found.

Like this:

Normal print statements will always show up here.
And here.
And so on...
100%|██████████████████| 2/2 [00:02<00:00,  1.01s/it, best loss: 36.8200744761246]

@PhilipMay
Copy link
Contributor Author

PhilipMay commented Jan 15, 2019

btw, how does this look in distributed setup (mongo etc.)?

Well, for mongo you pass a MongoTrials object to fmin instead of a "normal" Trials object. See here: https://github.com/hyperopt/hyperopt/wiki/Parallelizing-Evaluations-During-Search-via-MongoDB#2-use-mongotrials

I am pretty sure that they are handled by the same loop that is inside my progress bar. So yes it should work.

@PhilipMay
Copy link
Contributor Author

PhilipMay commented Jan 15, 2019

I am done with my work here with the PR.

The python 2.7 build is still broken though. :-(
What do you suggest?

@PhilipMay
Copy link
Contributor Author

When should I extend the documentation? https://github.com/hyperopt/hyperopt.github.io
After release?

@maxpumperla
Copy link
Contributor

@PhilipMay I tested locally, works with 2.7. Let's fix travis after this PR. Same goes for docs.

Thanks for the contribution, please keep it up! :)

@maxpumperla maxpumperla merged commit 068a9c0 into hyperopt:master Jan 20, 2019
@PhilipMay
Copy link
Contributor Author

Was fun to implement it and discuss it here. ! :-)

@trevorwelch
Copy link

Thankful for this! Great job!

@uduse
Copy link

uduse commented Mar 29, 2019

This is a nice feature to have, but unexpected output like this breaks doctests. Before this PR, I managed to silence hyperopt's output by setting the logger verbose level. However, it no longer works now. Since I also think having show_progressbar=True by default is a great idea, I suggest instead of using plain tqdm, pass tqdm to the logger so that projects do not care about hyperopt's output get this nice feature, and projects fiddled with hyperopt's logger level have consistent output behavior.

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.

None yet

4 participants