fancy progress bar
Project description
loadingpy
In this repository, we provide a custom made progress bar for python iterables. This library can be used as is or modified for any purposes (see licence).
for deep learning
There is now a new progress bar available for deep learning purposes (I guess it could be leveraged for other stuff as well...). Say, you want to train a model using a dataset $D$ over $e$ epochs. Using TrainBar
you can get a double progress bar (first for the epochs and second for the steps in the current epoch) on a single line. you can check the test or this simple example:
from loadingpy import TrainBar
for data in TrainBar(
trainloader,
num_epochs=e,
base_str="training",
):
inputs, labels = data
Example
You can install with pip pip install loadingpy
and use as follows
from loadingpy import PyBar
loss = 0.0
accuracy = 0.0
for inputs, labels in PyBar(dataset, monitoring=[loss, accuracy], naming=["loss", "accuracy"], base_str="training"):
# do whatever you please
loss += 0.0 # update monitoring variables in place
accuracy += 0.0 # update monitoring variables in place
For a more detailed exampel (in torch) check this tutorial. You can use a global argument in order to disable the verbatim from the loading bars as follows:
from loadingpy import BarConfig
BarConfig["disable loading bar"] = True
Arguments
Here is a list of the arguments and their description
argument | description | type |
---|---|---|
iterable | python object that can be iterated over | can be a list, tuple, range, np.ndarray, torch.Tensor, dataset,... |
monitoring | a python object (or list of python objects) that will be printed after each iteration using the following format f'{monitoring}'. IF they are updated during the loop, make sure to update inplace, in order to see the changes | an be a tensor, float or list of these |
naming | if you want to add a descritpion prefix to the monitoring variables | str or list of str |
total_steps | number of iterations to perform (if you set it to a lower value than the length of the iterable, then the process will stop after the given total_steps) | int |
base_str | prefix description of the loop we are iterating over | str |
color | which color to use for the loading bar | str |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for loadingpy-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 598ca5da7a8aac8f2c64f5458c0f1b6d0cff70b61ab282ded78f57ba974d0e33 |
|
MD5 | 5db43687ec30b5570cdb26712e11dbb9 |
|
BLAKE2b-256 | e9fa3e87992e9d1e0a8bdbddb1f4b54c8851dd9d1c94b20dc2df9222ba346115 |