A simple and compact one-line progress bar for TensorFlow 2 Keras.
TensorFlow Compact Progress Bar
Existing ways of monitoring training of TensorFlow Keras models either display nothing (verbose=0), one progress bar per epoch (verbose=1), or prints one line of metrics per epoch (verbose=2). When training for thousands of epochs, this often leads to bloated log files or crashed/sluggish Jupyter environments when working interactively.
This library provides a compact progress bar that simply displays the overall training progress by epoch. There are also a few small additional features for convenience, such as excluding certain metrics to avoid excessive clutter.
Notebook mode
Console mode
Getting Started
Install from PyPi:
$ pip install tf-compactprogbar
Dependencies
tensorflow >= 2(TF 1 likely works, but untested)tqdmpython >= 3.7ipywidgets(Optional)jupyterlab_widgets(Optional)
For nice looking Jupyter/IPython progress bars, make sure you have ipywidgets and jupyterlab_widgets if you are on Jupyter Lab.
Usage
To use it, disable the built-in logging (verbose=0) and pass it in as a Callback:
from tf_compactprogbar import CompactProgressBar
progBar = CompactProgressBar()
history = model.fit(X_train, Y_train,
epochs=200,
batch_size=100,
verbose=0,
validation_data = (X_test, Y_test),
callbacks=[progBar])
Documentation
# Call signature
CompactProgressBar(show_best=True, best_as_max=[], exclude=[], notebook='auto', epochs=None)
Args:
- show_best (bool) Display best metrics. Default: True
- best_as_max (list) Metrics which should be maximized (see note)
- exclude (list) Metrics which should be excluded from display
- notebook (str/bool) Whether to use IPython/Jupyter widget or console. Default: 'auto'
- epochs (int) Optional total number of epochs. Default is inferred from `.fit`.
Note: When using `show_best`, by default the "best" metric is the minimum. Pass
in the metric name to `best_as_max` to change this behavior.
If there are any issues in Jupyter, please see the tqdm Issues page for help or disable notebook mode with notebook=False.
Metadata
Release files for tf-compactprogbar 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tf_compactprogbar-1.0.2.tar.gz | 6.7 kB | Without provenance | Details for tf_compactprogbar-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tf_compactprogbar-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for tf_compactprogbar-1.0.2-py3-none-any.whl |
Total release size: 12.5 kB
Release files / tf_compactprogbar-1.0.2.tar.gz
| Download URL | tf_compactprogbar-1.0.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b89a9d92aadf6ac810ec4b3b9a13facb4ca3d05831bcf0a31146d88ef606492
|
|
BLAKE2b-256 checksum How to use checksums |
e8f8cf1a543fbf15b6f76fe0b577c0d8afee5847118469cab98e1b33682086f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / tf_compactprogbar-1.0.2-py3-none-any.whl
| Download URL | tf_compactprogbar-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02cd9ebeff4eab3871407e9c303c5a2bf4608d20f76a8234209a2d6befd3851c
|
|
BLAKE2b-256 checksum How to use checksums |
460c30cd51c4ad9db18bde4ad281d617ae7f87064d7315e7d0e134b61917c0b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for tf-compactprogbar 1.0.2
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.