An easy-to-use debug print tool for deep learning studies in python.
Project description
python-dprint
An easy-to-use debug print tool for deep learning studies in python. DEMO
Why we need it?
The built-in debugger is great, however, for some reason, we may still want to print them out for debugging purpose. For such scenarios, we would like it to have the following feats. (especially when running deep learning projects - where our monitoring/debugging variables are being updated within loops).
-
Context Info. We may like to display the invoking positions for these variables (to help us identify back each of them), including their file name, func name, and line number.
-
Different Color. We may like it to be clearly distinguishable from tons of normal printings within loops, such as displaying training loss. The default color is YELLOW now, which could be custmozed in future releases soon (full color-code can be found here).
-
Pass-Through Print. We may like to monitor things without breaking current code structure, i.e., print-and-return. Note: you can still simply
dprint()
them (just like print() in python) - it's compatible to both usecases.
#loss = loss1 + loss2
loss = loss1 + dprint(loss2)
- (Optional) Multiple Variables. We may not like to leave too much dprint() statement in our code - they look redundent - instead, we may like to display multiple variable within lines as less as possible (by passing them all as a dict).
How we use it?
Very easy :)
- Installation
pip install pydprint
- Import
from pydprint import dprint
- Demo Usecases: demo.py (see some examples).
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
File details
Details for the file pydprint-0.0.4.tar.gz
.
File metadata
- Download URL: pydprint-0.0.4.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.1 importlib-metadata/4.6.4 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3ee9791a5233f7b3f2ea9944c4f8ce7ddb276b4eb2d381036e333e758cc1ef |
|
MD5 | 69a70df95c3cb40d7191b4dbde184e5d |
|
BLAKE2b-256 | e55cf9887fd6ba912a8b6da7dbb8f81b6fc639c592f9fccfeb6279acb2a046c0 |
File details
Details for the file pydprint-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: pydprint-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.1 importlib-metadata/4.6.4 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14376674280cde1615715b5899e1c91c68a485e35a561956ecba2ab2bd6ce3e9 |
|
MD5 | 90387a29963b3f25c59eb6883ad72911 |
|
BLAKE2b-256 | ba0bcd7e57b8df8e06fc945e7aa615ccc4638f1def694a41f4c66a172a79c242 |