Skip to main content

No project description provided

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 TrainBaryou 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loadingpy-0.1.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

loadingpy-0.1.4-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file loadingpy-0.1.4.tar.gz.

File metadata

  • Download URL: loadingpy-0.1.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.18 Darwin/23.2.0

File hashes

Hashes for loadingpy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3447dacb40d4747840182cfc8eb8247f29e6882fdf3c63d71a73d32085c83c8e
MD5 1a90a571eddfa7b9860ec2f19da7a38d
BLAKE2b-256 48e4354b303627ba1db9be80e68505c1fed7d0812d60a3a4927135415a423eed

See more details on using hashes here.

File details

Details for the file loadingpy-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: loadingpy-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.18 Darwin/23.2.0

File hashes

Hashes for loadingpy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ff380f06b9f2eff89a1584a4e67ebe505d3981bfa241e0ec374ce75337263571
MD5 cc8b362f370e7d051116a2c78672a794
BLAKE2b-256 85ad54d90f189d4248bc3addaced86628e0b58df50137fbe8c013c8bca1d2c2d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page