File size: 5,214 Bytes
492077a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15f5916
492077a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3a9b28d
 
492077a
 
 
 
 
 
 
 
15f5916
492077a
 
3a9b28d
492077a
 
3a9b28d
492077a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3a9b28d
 
492077a
 
 
 
 
 
3a9b28d
 
 
 
492077a
15f5916
3a9b28d
492077a
 
15f5916
3a9b28d
492077a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
license: bsd-3-clause
library_name: pytorch
tags:
  - energy-tweedie
  - denoising
  - score-matching
  - scoring-rules
  - diffusion-models
  - generative-modeling
  - noise-estimation
  - neurips-2026
thumbnail: https://raw.githubusercontent.com/andleb/et/main/docs/score_fields.png
---

# Energy-Tweedie: Score meets Score, Energy meets Energy

**Andrej Leban 路 University of Michigan 路 NeurIPS 2026**

[Paper](https://arxiv.org/abs/2512.23818) 路
[Code](https://github.com/andleb/et) 路
[Project page](https://andleb.netlify.app/publication/et/) 路
[Checkpoints](https://huggingface.co/andleb/et/tree/main)

The paper lifts the Tweedie formula to a distributional identity valid for Gibbs noise distributions, with several applications such as a posterior-samples-to-score route, estimating unknown noise parameters from corrupted data, and providing the score-based perspective on recent "distributional" diffusion methods.

This repository hosts the released PyTorch checkpoints and saved configurations for the paper's Eight-Gaussians and MNIST experiments. The files match the [public code repository](https://github.com/andleb/et/tree/main/models) and the [MNIST model release](https://github.com/andleb/et/releases/tag/MNIST_model).

![Energy-Tweedie score fields for Eight-Gaussians as each noise parameter is varied. Color shows the score magnitude on a log scale.](https://raw.githubusercontent.com/andleb/et/main/docs/score_fields.png)

## Checkpoints

| Directory | Models | Experiments |
| --- | --- | --- |
| `score_and_diffusion/` | Isotropic Gaussian, isotropic generalized-Gaussian, and five-parameter posterior models | Score estimation, Richardson extrapolation, and diffusion-style sampling on Eight-Gaussians |
| `score_comparison/` | ET-DSM and Hyv盲rinen direct-score models | Three-estimator score comparison on Eight-Gaussians |
| `parameter_estimation/` | Posterior and score models | Noise-parameter recovery on Eight-Gaussians |
| `mnist/posterior/` | Five-parameter MNIST posterior | Five sampling paths on MNIST |

Each checkpoint has an adjacent `config.yaml` or `config.json`. The [reproduction notebooks](https://github.com/andleb/et#reproducing-the-results) use these saved configurations; the [training scripts](https://github.com/andleb/et#training) provide editable defaults for retraining.

The root [config.json](https://huggingface.co/andleb/et/blob/main/config.json) indexes each checkpoint and its saved configuration.

## Download

Follow the [code installation instructions](https://github.com/andleb/et#installation), then run from the code repository root. The Hub root corresponds to `models/` in the code repository.

Download all released checkpoints and configurations:

```bash
python -m pip install huggingface_hub
hf download andleb/et --local-dir models
```

To download the MNIST checkpoint, its configuration, and the index:

```bash
hf download andleb/et config.json mnist/posterior/final.pt mnist/posterior/config.yaml --local-dir models
```

Then generate the MNIST samples with the provided runner:

```bash
bash exp/sample_diffusion_mnist.sh
```

The [MNIST notebook](https://github.com/andleb/et/blob/main/exp/reproduce_diffusion_mnist.ipynb) loads these samples and computes the comparisons presented in the paper. The [Eight-Gaussians notebooks](https://github.com/andleb/et#reproducing-the-results) evaluate the corresponding checkpoints.

## Load the MNIST model in Python

After installing the code repository and `huggingface_hub`, run from the code repository root:

```python
import json

import torch
from huggingface_hub import hf_hub_download
from omegaconf import OmegaConf

from utils.mnist import build_mnist_engressor

index_path = hf_hub_download(repo_id="andleb/et", filename="config.json")
with open(index_path) as handle:
    model_files = json.load(handle)["checkpoints"]["mnist/posterior"]

config_path = hf_hub_download(
    repo_id="andleb/et",
    filename=model_files["config"],
)
checkpoint_path = hf_hub_download(
    repo_id="andleb/et",
    filename=model_files["weights"],
)
config = OmegaConf.load(config_path)
checkpoint = torch.load(checkpoint_path, map_location="cpu", weights_only=True)
engressor = build_mnist_engressor(config, device="cpu")
engressor.model.load_state_dict(checkpoint["model_state_dict"])
engressor.model.eval()
```

The [MNIST sampling code](https://github.com/andleb/et/blob/main/exp/sample_diffusion_mnist.py) applies the noise-parameter conditioning and Energy-Tweedie sampler.

## License and citation

Released under the [BSD 3-Clause license](https://github.com/andleb/et/blob/main/LICENSE). The code repository includes [third-party attribution](https://github.com/andleb/et/blob/main/third_party_licenses/THIRD_PARTY_LICENSES.md).

If you use this work, please cite the paper:

```bibtex
@inproceedings{leban2026energytweedie,
  title         = {Energy-Tweedie: Score meets Score, Energy meets Energy},
  author        = {Andrej Leban},
  booktitle     = {Advances in Neural Information Processing Systems},
  year          = {2026},
  eprint        = {2512.23818},
  archivePrefix = {arXiv},
  primaryClass  = {stat.ML},
  url           = {https://arxiv.org/abs/2512.23818}
}
```