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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87e614129e49d4eefa7d60e68ce303afb920d0e41241e0b9342ea3fa1c1b3e7 |
|
MD5 | 5011ec9b35e5a32bf4768edef917bc99 |
|
BLAKE2b-256 | ba4088a3961b6fab51d4503adac825a14c91eea8f21f598ad5e465fd96e3358d |