bstriner / keras-tqdm

Keras integration with TQDM progress bars
MIT License
348 stars 41 forks source link

no need for extra loop #3

Closed stared closed 7 years ago

stared commented 7 years ago

There is no need for extra loop, i.e. for i in range(10) - epochs work as expected.

(A side remark - I would default for one progress bar, as below (important for many-epoch training). Or at least - explain that it is an option.)

screenshot from 2017-01-10 17-37-09

bstriner commented 7 years ago

Great point on leave_inner! Github readme updated with some examples.

Progress bars will display correctly in normal for loops but putting them within other TQDM loops means that you can get an ETA for the whole process and nicely nested loops. TQDM cuts out all of that work regarding timing your code and estimating the ETA.

If you're training several models for many epochs in a notebook, probably best to use tqdm_notebook(leave=True) for your outer loop, and TQDMNotebookCallback(leave_inner=False, leave_outer=False) for training.

That should give you a total of 3 progress bars at any time: each model, each epoch, each batch.

Updates in the master branch on github. Haven't pushed to PyPI yet.

Cheers, Ben

stared commented 7 years ago

I saw that, great!

And if I have some idea for expanding README, is it fine to give a PR?

bstriner commented 7 years ago

Of course! Can't guarantee I'm not going to edit it but any help is welcome. This started from a discussion on a keras issue a few weeks ago but the progress bars looked so good I wanted to package the whole thing up.

BTW, keras is starting a contrib repository, so I might move this code into contrib once that is set up.

Cheers, Ben

stared commented 7 years ago

OK, I changes things, including separating the simplest use case from a more advanced one. See: https://github.com/bstriner/keras-tqdm/pull/4 - I am curious if you like this direction!