Skip to main content

keras-tqdm

Keras integration with TQDM progress bars.

  • Keras is an awesome machine learning library for Theano or TensorFlow.

  • TQDM is a progress bar library with good support for nested loops and Jupyter/IPython notebooks.

Key features

  • TQDM supports nested progress bars. If you have Keras fit and predict loops within an outer TQDM loop, the nested loops will display properly.

  • TQDM supports Jupyter/IPython notebooks.

  • TQDM looks great!

TQDMNotebookCallback with leave_inner=False (default)

Keras TQDM leave_inner=False

TQDMNotebookCallback with leave_inner=True

Keras TQDM leave_inner=True

TQDMCallback for command-line scripts

Keras TQDM CLI

Installation

Stable release

pip install keras-tqdm

Development release

pip install git+https://github.com/bstriner/keras-tqdm.git --upgrade --no-deps

Development mode (changes to source take effect without reinstalling)

git clone https://github.com/bstriner/keras-tqdm.git
cd keras-tqdm
python setup.py develop

Basic usage

It’s very easy to use Keras TQDM. The only required change is to remove default messages (verbose=0) and add a callback to model.fit. The rest happens automatically! For Jupyter Notebook required code modification is as simple as:

from keras_tqdm import TQDMNotebookCallback
# keras, model definition...
model.fit(X_train, Y_train, verbose=0, callbacks=[TQDMNotebookCallback()])

For plain text mode (e.g. for Python run from command line)

from keras_tqdm import TQDMCallback
# keras, model definition...
model.fit(X_train, Y_train, verbose=0, callbacks=[TQDMCallback()])

Advanced usage

Use keras_tqdm to utilize TQDM progress bars for Keras fit loops. keras_tqdm loops can be nested inside TQDM loops to display nested progress bars (although you can use them inside ordinary for loops as well). Set verbose=0 to suppress the default progress bar.

from keras_tqdm import TQDMCallback
from tqdm import tqdm
for model in tqdm(models, desc="Training several models"):
    model.fit(x, y, verbose=0, callbacks=[TQDMCallback()])

For IPython and Jupyter notebook TQDMNotebookCallback instead of TQDMCallback. Use tqdm_notebook in your own code instead of tqdm. Formatting is controlled by python format strings. The default metric_format is "{name}: {value:0.3f}". For example, use TQDMCallback(metric_format="{name}: {value:0.6f}") for 6 decimal points or {name}: {value:e} for scientific notation.

Questions?

Please feel free to submit PRs and issues. Comments, questions, and requests are welcome. If you need more control, subclass TQDMCallback and override the tqdm function.

Metadata

Release files for keras-tqdm 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keras-tqdm 2.0.1
File Size Uploaded Provenance Actions
keras_tqdm-2.0.1.tar.gz 4.4 kB Without provenance Details for keras_tqdm-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keras-tqdm 2.0.1
File Interpreter ABI Platform Actions
keras_tqdm-2.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for keras_tqdm-2.0.1-py2.py3-none-any.whl

Total release size: 11.5 kB

Release files / keras_tqdm-2.0.1.tar.gz

Download URL keras_tqdm-2.0.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d5deb3bd201a66285fb796f240e6fb52ecb76fe6253bb72d6bb832abebe59f47
BLAKE2b-256 checksum
How to use checksums
ce02bf464481236468315d4b2ccc1e3abd95602fba98508c68e38259d7483853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / keras_tqdm-2.0.1-py2.py3-none-any.whl

Download URL keras_tqdm-2.0.1-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3f5b093d49852fc4c9bfeffdc17c8f3eb98b1e530dbd8cc407cf37d197a1dc3b
BLAKE2b-256 checksum
How to use checksums
165cac63c65b79a895b8994474de2ad4d5b66ac0796b8903d60cfea3f8308d5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for keras-tqdm 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page