SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.15103 · NeurIPS · 2023

Energy-Based Learning Algorithms for Analog Computing: A Comparative Study

Maxence Ernoult, Benjamin Scellier, Jack Kendall, Suhas Kumar

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2312.15103.json · badge: /api/ran/2312.15103.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
rain-neuromorphics/energy-based-learning canonical (classifier label)
classifier basis: classifier_2025
2 ran · 2 no recorded run
FunctionStatusWhere it lives
Minimizer Ran
ran on a synthesized input · constructed an object; no result was computed
rain-neuromorphics/energy-based-learning/model/resistive/minimizer.py
code served (permissive licence) · get_code("f0ebec13c974eddd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Minimizer: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create stand-in classes for Layer, Parameter, and LayerUpdater
class Parameter:
    def __init__(self, name, state):
        self.name = name
        self.state = state

class Layer:
    def __init__(self, name, state):
        self.name = name
        self.state = state
    
    def activate(self):
        """Return activated state"""
        return torch.relu(self.state)

class LayerUpdater:
    def __init__(self, layer):
        self._layer = layer
    
    def pre_activate(self):
        """Return pre-activation state"""
        return self._layer.state + 0.1 * torch.randn_like(self._layer.state)

class SimpleFunction:
    """Stand-in function class with layers() and params() methods"""
    def __init__(self, layers, params):
        self._layers = layers
        self._params = params
    
    def layers(self):
        return self._layers
    
    def params(self):
        return self._params

# Create minimal layers with distinct sizes
layer1 = Layer("layer1", torch.randn(2, 4))
layer2 = Layer("layer2", torch.randn(2, 3))
layer3 = Layer("layer3", torch.randn(2, 5))

layers = [layer1, layer2, layer3]

# Create parameters
param1 = Parameter("param1", torch.randn(4, 3))
param2 = Parameter("param2", torch.randn(3, 2))

params = [param1, param2]

# Create updaters for each layer
updaters = [LayerUpdater(layer) for layer in layers]

# Create function object
fn = SimpleFunction(layers, params)

# Define arguments dictionary
ARGS = {
    'fn': fn,
    'updaters': updaters,
    'num_iterations': 5,
    'mode': 'asynchronous'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Minimizer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Minimizer output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
QuadraticUpdater Ran
ran on a synthesized input · constructed an object; no result was computed
rain-neuromorphics/energy-based-learning/model/resistive/minimizer.py
code served (permissive licence) · get_code("ac3ccd9e66ea00c4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, QuadraticUpdater: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal Layer class
class Layer(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, 3))
    
    def forward(self, x):
        return x @ self.weight

# Define a minimal Function class with required methods
class Function:
    def __init__(self, layer):
        self.layer = layer
    
    def grad_layer_fn(self, layer):
        # Returns a function that computes gradient
        def grad_fn():
            return torch.randn(2, 3)
        return grad_fn
    
    def a_coef_fn(self, layer):
        # Returns a function that computes coefficient a
        def a_fn():
            return torch.ones(2, 3) * 0.5
        return a_fn
    
    def b_coef_fn(self, layer):
        # Returns a function that computes coefficient b
        def b_fn():
            return torch.randn(2, 3)
        return b_fn

# Create instances
layer = Layer()
fn = Function(layer)

ARGS = {
    "layer": layer,
    "fn": fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type QuadraticUpdater — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a QuadraticUpdater output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
LayerUpdater Not yet run
unverified (harvested, no recorded run)
rain-neuromorphics/energy-based-learning/model/resistive/minimizer.py
code served (permissive licence) · get_code("c9e47a23b23a2895")
How it ran

no invocation recorded.

QuadraticMinimizer Not yet run
unverified (harvested, no recorded run)
rain-neuromorphics/energy-based-learning/model/resistive/minimizer.py
code served (permissive licence) · get_code("61be018017b8ab14")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Energy-based learning algorithms have recently gained a surge of interest due to their compatibility with analog (post-digital) hardware. Existing algorithms include contrastive learning (CL), equilibrium propagation (EP) and coupled learning (CpL), all consisting in contrasting two states, and differing in the type of perturbation used to obtain the second state from the first one. However, these algorithms have never been explicitly compared on equal footing with same models and datasets, making it difficult to assess their scalability and decide which one to select in practice. In this work, we carry out a comparison of seven learning algorithms, namely CL and different variants of EP and CpL depending on the signs of the perturbations. Specifically, using these learning algorithms, we train deep convolutional Hopfield networks (DCHNs) on five vision tasks (MNIST, F-MNIST, SVHN, CIFAR-10 and CIFAR-100). We find that, while all algorithms yield comparable performance on MNIST, important differences in performance arise as the difficulty of the task increases. Our key findings reveal that negative perturbations are better than positive ones, and highlight the centered variant of EP (which uses two perturbations of opposite sign) as the best-performing algorithm. We also endorse these findings with theoretical arguments. Additionally, we establish new SOTA results with DCHNs on all five datasets, both in performance and speed. In particular, our DCHN simulations are 13.5 times faster with respect to Laborieux et al. [2021], which we achieve thanks to the use of a novel energy minimisation algorithm based on asynchronous updates, combined with reduced precision (16 bits).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2312.15103")
get_code_for_paper("2312.15103")
have("2312.15103")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2312.15103.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2312.15103.svg)](https://syntology.ai/paper/2312.15103)

Connect an agent — have() is free.