All models

score_matching_mlp_ebm

A small MLP energy model fit by score matching, which needs no normalizing constant.

Diffusion and generative · 6 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (9 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
17K
Operations
6
Framework
PyTorch
Recurrent
No
Published
2005, Journal of Machine Learning Research 6(24):695-709
Cited by
696 (as of 18 October 2026)
Authors
Aapo Hyvärinen
License
GPL-3.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m9091
Graph hash
23318fa535fb357000d0f542288844a8bbe751b2ab3c93f125b0790117892087
Skeleton hash
b9dd344f935c6307d3b580c1b86afa6114e60ab80265ba34332e879ff15fcfc7
Architecture hash
dd35cc412aae6058e08d02493deeef5977d002d921071d9f959078fd381e22eb
Diagram SHA-256
a3d9b5804703802017b89c95a78cd1cb2a5bc3aeae8e74e34c35e0732dea3f8c
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This is a small energy-based model, a network that assigns a scalar energy to each input point, trained by score matching, a method particularly suited to learning unnormalized statistical models. Score matching exists for models whose probability density is known only up to a multiplicative normalization constant. Instead of Markov Chain Monte Carlo or approximating the constant, it minimizes the expected squared distance between the gradient of the model's log-density and the gradient of the data's log-density.

The surprising result is that the data density drops out of the objective, which reduces to a sample average of derivatives of the model's log-density. The catch is that plain score matching needs the diagonal of the Hessian of the log-density, which is expensive for deep models. Sliced score matching gets around this by projecting the scores onto random vectors before comparing them, so only Hessian-vector products are needed. The sliced variant is shown to learn deep energy-based models effectively.

The sliced score matching code repository is a PyTorch implementation that can train unnormalized statistical models or estimate the score of data. In the original paper the method was demonstrated on multivariate Gaussian and independent component analysis models, and by estimating an overcomplete filter set for natural image data.

Key idea. Score matching estimates unnormalized models by matching the gradient of the model log-density to that of the data, with an objective in which the unknown data density never appears.

  • score matching
  • sliced score matching
  • energy-based model
  • EBM
  • unnormalized statistical model
  • Hyvärinen
  • Fisher divergence
  • score estimation
  • log-density gradient

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{scorematchingebm2005,
  title = {Estimation of Non-Normalized Statistical Models by Score Matching},
  author = {Aapo Hyvärinen},
  year = {2005},
  journal = {Journal of Machine Learning Research 6(24):695-709}
}