Skip to main content

Gradient Explorer Python Client Library

Project description

gradexp

Like wandb, but for tensors.

gradexp logs tensors from Python and lets you inspect them in Gradient Explorer, either in the hosted app or a local viewer.

Quickstart

pip install gradexp
gradexp login
# For local mode:
gradexp local open

Example:

import gradexp
import numpy as np

gradexp.init(project_name="examples", run_name="hello-gradexp")

for step in range(10):
    tensor = np.random.randn(224, 224, 3).astype(np.float32)
    gradexp.log(tensor, name="tensor")

When gradexp.init() succeeds, it prints a run URL. If a local instance is running, data is routed there automatically.

Note: tensor names are immutable once a tensor is created — they're keys into per-tensor stats and shape metadata. Choose names carefully on the first log call. Project and run names can be renamed in the explorer UI; tensor names cannot.

Semantic Model Tensor Views

gradexp.log_model_tensors(model) and gradexp.log_gradient_stats(model) log model.named_parameters() by default. Models that store several logical layers in one banked parameter can provide a semantic view by defining:

def gradexp_unbank_state_dict(self, state_dict):
    ...

The method receives a mapping of raw parameter names to tensors and returns a mapping of semantic names to tensors. Gradexp calls it automatically when present, for both weights and gradients:

class GPT(nn.Module):
    def gradexp_unbank_state_dict(self, state_dict):
        return _unbank_state_dict(state_dict, self.num_layers)

Use semantic=False or semantic="raw" to force raw PyTorch parameter names.

Common CLI Commands

gradexp login
gradexp local open
gradexp local start
gradexp local status
gradexp local stop
gradexp local sync

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

gradexp-0.1.28.tar.gz (571.0 kB view details)

Uploaded Source

Built Distribution

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

gradexp-0.1.28-py3-none-any.whl (561.5 kB view details)

Uploaded Python 3

File details

Details for the file gradexp-0.1.28.tar.gz.

File metadata

  • Download URL: gradexp-0.1.28.tar.gz
  • Upload date:
  • Size: 571.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gradexp-0.1.28.tar.gz
Algorithm Hash digest
SHA256 fa51aafe7c335d55ca5b3812725b8d255f2e5a01db8d6818dc3cdfade7326d74
MD5 8ae60788f2720bc5ee3f5c9718bf5f6f
BLAKE2b-256 46ffc335674a96ee61a85c7225e5ffaee7ba1140ff0a955154f813a50959fbce

See more details on using hashes here.

File details

Details for the file gradexp-0.1.28-py3-none-any.whl.

File metadata

  • Download URL: gradexp-0.1.28-py3-none-any.whl
  • Upload date:
  • Size: 561.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gradexp-0.1.28-py3-none-any.whl
Algorithm Hash digest
SHA256 a8568653c2a02db0757bba7e82d15ba637598fb4415029f4058ced2c3523a920
MD5 01880901edb1dcc0934029e3d682d784
BLAKE2b-256 60da6e55cc5368189692f9a0d90a021ddbd708ace6998f274c919635d25f00b4

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