Diffract¶
Diffract is a Python library for analyzing deep neural network weights and tracking how they evolve during training.
Installation¶
Diffract requires Python 3.12:
pip install diffract-core
For development, clone the repository and install with uv, which provisions Python automatically:
git clone https://github.com/Risk-AI-Research/diffract.git
cd diffract
uv sync --extra dev
Optional extras¶
Extra |
Description |
|---|---|
|
PyTorch model support |
|
TensorFlow/Keras model support |
|
Flax/JAX model support |
|
ONNX model support |
|
TensorFlow + Flax + ONNX bundle |
|
Plotly visualization helpers |
|
Export to pandas DataFrames |
|
Export to polars DataFrames |
|
Redis cache backend |
|
Zarr storage backend (cloud-native arrays via fsspec) |
|
Taichi-accelerated heavy-tailed fitting and bootstrap p-value kernels |
|
viz + pandas + polars (recommended) |
|
torch + viz + taichi + pandas + polars |
|
Dependencies for the example notebooks |
|
Build this documentation |
Install extras with pip install "diffract-core[torch,common]" (quotes matter
in zsh), or uv sync --extra torch --extra common in a clone.
Start here¶
What Diffract is, core concepts, and when to use it.
5-minute tour: Session → models.add → compute.apply → results.export_metrics → viz.draw.
Focused how-tos: filtering, kernels, exports, storage backends.
Docstring-driven reference starting from Session.