Skip to main content

Lightweight PyTorch tensor diagnostics hooks for training loops

Project description

model-diagnostics

Install

pip install model-diagnostics

Quick Start

from model_diagnostics import maybe_attach_diagnostics

diag = maybe_attach_diagnostics(model)

for step, batch in enumerate(train_loader):
    loss = train_step(batch)
    loss.backward()
    optimizer.step()
    optimizer.zero_grad()

    if diag and diag.should_stop(step, stop_after_steps=6):
        diag.print(f"{args.exp_dir}/diagnostics-step-{step}.txt")
        break

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

nndiagnostics-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nndiagnostics-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file nndiagnostics-0.1.0.tar.gz.

File metadata

  • Download URL: nndiagnostics-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.20

File hashes

Hashes for nndiagnostics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c6f67a927b43fb614b8c22026d280c8ec52a3674b966032beaa3a08257f83ef3
MD5 bd945e4d828979b8b915ae21f6a8380e
BLAKE2b-256 ad1da53ce674e8779a41830d5d9119457cf27de672d23e520a1f05615f7deefe

See more details on using hashes here.

File details

Details for the file nndiagnostics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nndiagnostics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.20

File hashes

Hashes for nndiagnostics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 365a888fd8157f5e967d35e000e3150de27c6385f707a0bbf128baf13e9c421b
MD5 bfe4598a2205a393a51bd20be772d7b2
BLAKE2b-256 917bf6ac4a2ffcd6a344ced08eea96ef8a03e722662471432b5759c2c46c703a

See more details on using hashes here.

Supported by

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