traice
Tiny yet useful tool for consistent model training logs generation.
Installation
To install through pip use the following command:
pip install traice
The tool requires only pandas package to be installed. However, there is environment.yml file which can be used for the same environment which is used for developing the tool:
conda env create -f environment.yml
Usage
The tool may be used as follows (see examples/dummy.py):
from random import seed, uniform
from time import time, sleep
from traice import Traicer
traicer = Traicer()
def train_step():
sleep(uniform(0, 1))
seed(17)
init_timestamp = time()
for i in range(1, 5):
start_timestamp = time()
train_step()
traicer.push(i, uniform(0, 1 / i), (time_ := time()) - start_timestamp, time_ - init_timestamp)
print(traicer.df)
Essentially, it accumulates all push arguments in a list which is then converted to a dataframe. The example produces the following log (the last two columns may differ a bit):
epoch loss time cumulative_time
0 1 0.806691 0.522609 0.522609
1 2 0.144813 0.961565 1.484184
2 3 0.234740 0.767061 2.251254
3 4 0.027541 0.661659 2.912921
Testing
To run test execute the following statement in your terminal:
python -m unittest discover test
Metadata
Release files for traice 0.2.0
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 |
|---|---|---|---|---|
| traice-0.2.0.tar.gz | 6.4 kB | Without provenance | Details for traice-0.2.0.tar.gz |
Release files / traice-0.2.0.tar.gz
| Download URL | traice-0.2.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
239e0773dc5c88e36a178aac9a712949427a44780a6269530157395b5b6ed7eb
|
|
BLAKE2b-256 checksum How to use checksums |
1dcbc4a2a28634360e34a6bd1098841d5fcac2149d4c0874e3a8d9f14051c6c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.8
|
Security for traice 0.2.0
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.