SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.13889 · NeurIPS · 2021

Equilibrium and non-Equilibrium regimes in the learning of Restricted Boltzmann Machines

Aurélien Decelle, Cyril Furtlehner, Beatriz Seoane

arXiv · PDF · Open in the Atlas

Code that ran

15 of 21 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 15 have no contract verdict; 0 failures of our instrument; 6 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/2105.13889.json · badge: /api/ran/2105.13889.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
AurelienDecelle/TorchRBM canonical (classifier label)
classifier basis: census
15 ran · 6 no recorded run
FunctionStatusWhere it lives
compute_energy Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/binary/functions.py
code served (permissive licence) · get_code("988ee22a5cfe4623")
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 Tensor, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

torch.manual_seed(0)

# Analyze the function:
# - chains: Dict with keys 'v' and 'h', both are tensors
#   - chains['v'] is used in matrix multiplication with params['vbias'] and params['weight_matrix']
#   - chains['h'] is used in matrix multiplication with params['hbias'] and element-wise multiplication
# - params: Dict with keys 'vbias', 'hbias', 'weight_matrix'
#   - 'vbias': result of chains['v'] @ params['vbias'], so if v is (batch, v_dim), vbias is (v_dim,)
#   - 'hbias': result of chains['h'] @ params['hbias'], so if h is (batch, h_dim), hbias is (h_dim,)
#   - 'weight_matrix': used in chains['v'] @ params['weight_matrix'] * chains['h']
#     This suggests weight_matrix is (v_dim, h_dim) to give output (batch, h_dim)

batch_size = 2
v_dim = 4
h_dim = 3

chains = {
    'v': torch.randn(batch_size, v_dim),
    'h': torch.randn(batch_size, h_dim),
}

params = {
    'vbias': torch.randn(v_dim),
    'hbias': torch.randn(h_dim),
    'weight_matrix': torch.randn(v_dim, h_dim),
}

ARGS = {
    'chains': chains,
    'params': params,
}
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 Tensor, ndim 1, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:OSError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
decode_sequence Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/fasta_utils.py
code served (permissive licence) · get_code("e663927a1fd4a268")
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 str. 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 numpy as np

# Create a small numeric sequence
sequence = np.array([0, 1, 2, 1, 0])

# Create an alphabet string for tokens
tokens = "ACGT"

# Construct the arguments dictionary
ARGS = {
    "sequence": sequence,
    "tokens": tokens
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
encode_sequence Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/fasta_utils.py
code served (permissive licence) · get_code("1a53c80144c46b56")
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 ndarray, ndim 1, dtype family int, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# Define arguments for encode_sequence function
sequence = "ATCG"
tokens = "ACGT"

ARGS = {
    "sequence": sequence,
    "tokens": tokens,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_checkpoints Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/train_rbm.py
code served (permissive licence) · get_code("382f6ab51c407594")
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 ndarray, ndim 1, dtype family int, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np
from argparse import Namespace

ARGS = {
    'args': Namespace(
        spacing='exp',
        num_updates=1000,
        n_save=5
    )
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_correlation_two_points Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/potts/analysis.py
code served (permissive licence) · get_code("ca76906ffea7ac52")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# Set up tensor dimensions
L = 4  # number of positions
q = 3  # alphabet size

# Create two-point frequency tensors for data and chains
# Shape: (L, q, L, q)
fij = torch.randn(L, q, L, q)
pij = torch.randn(L, q, L, q)

# Create single-point frequency tensors
# Shape: (L, q)
fi = torch.randn(L, q)
pi = torch.randn(L, q)

ARGS = {
    "fij": fij,
    "pij": pij,
    "fi": fi,
    "pi": pi,
}
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 Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_eigenvalues_history Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/utils.py
code served (permissive licence) · get_code("e9494c740da5d283")
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 tuple. 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 h5py
import numpy as np
import tempfile
import os

# Create a temporary HDF5 file with the expected structure
temp_dir = tempfile.mkdtemp()
filename = os.path.join(temp_dir, "test_eigenvalues.h5")

# Create HDF5 file with update entries
with h5py.File(filename, 'w') as f:
    # Create multiple update entries with weight matrices
    for i in range(3):
        group = f.create_group(f'update_{i}')
        # Create weight matrices of different shapes to test reshaping
        # Shape: (4, 3, 2) which will be reshaped to (-1, 2) = (12, 2)
        weight_matrix = np.random.randn(4, 3, 2).astype(np.float32)
        group.create_dataset('weight_matrix', data=weight_matrix)

ARGS = {
    'filename': filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
get_freq_single_point Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/potts/analysis.py
code served (permissive licence) · get_code("fc6d84a6b04c2cdb")
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 Tensor, ndim 2, dtype family float, shape (4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# Construct arguments for get_freq_single_point
# data: one-hot encoded matrix (M, L, q) where M=sequences, L=length, q=alphabet size
M, L, q = 2, 4, 3
data = torch.zeros(M, L, q)
# Create one-hot encoded data
data[0, 0, 0] = 1.0
data[0, 1, 1] = 1.0
data[0, 2, 2] = 1.0
data[0, 3, 0] = 1.0
data[1, 0, 1] = 1.0
data[1, 1, 2] = 1.0
data[1, 2, 0] = 1.0
data[1, 3, 1] = 1.0

# weights: tensor of shape (M,) with sequence weights
weights = torch.tensor([1.0, 2.0])

# pseudo_count: small float value for regularization
pseudo_count = 0.1

ARGS = {
    "data": data,
    "weights": weights,
    "pseudo_count": pseudo_count,
}
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 Tensor, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_freq_two_points Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/potts/analysis.py
code served (permissive licence) · get_code("655fe87a7cd34456")
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 Tensor, ndim 4, dtype family float, shape (4, 3, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# Create a small one-hot encoded MSA tensor
# Shape: (M, L, q) where M=sequences, L=positions, q=alphabet size
M, L, q = 2, 4, 3
data = torch.zeros(M, L, q)
# Create valid one-hot encodings
data[0, 0, 0] = 1.0
data[0, 1, 1] = 1.0
data[0, 2, 2] = 1.0
data[0, 3, 0] = 1.0
data[1, 0, 1] = 1.0
data[1, 1, 2] = 1.0
data[1, 2, 0] = 1.0
data[1, 3, 1] = 1.0

# Create weights for sequences
weights = torch.tensor([1.0, 1.0])

# Pseudo count for regularization
pseudo_count = 0.01

ARGS = {
    "data": data,
    "weights": weights,
    "pseudo_count": pseudo_count,
}
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 Tensor, ndim 4, dtype family float, shape (4, 3, 4, 3) — shape (4, 3, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_ortho Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/custom_fn.py
code served (permissive licence) · get_code("c051bc08d750fbf0")
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 Tensor, ndim 2, dtype family float, shape (5, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# Create a small matrix with distinct dimensions (5 rows, 3 columns)
# This will be orthonormalized by columns
mat = torch.randn(5, 3, dtype=torch.float32)

ARGS = {
    "mat": mat,
}
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 Tensor, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_tokens Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/fasta_utils.py
code served (permissive licence) · get_code("7eff798ee21e285c")
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 str. 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 numpy as np

tokens_protein = 'ACDEFGHIKLMNPQRSTVWY-'
tokens_rna = 'ACGU-'
tokens_dna = 'ACGT-'

def get_tokens(alphabet):
    assert isinstance(alphabet, str), "Argument 'alphabet' must be of type str"
    if alphabet == 'protein':
        return tokens_protein
    elif alphabet == 'rna':
        return tokens_rna
    elif alphabet == 'dna':
        return tokens_dna
    else:
        return alphabet

ARGS = {
    'alphabet': 'protein'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
init_chains Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/binary/functions.py
code served (permissive licence) · get_code("62543dbc3abecc1b")
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 dict. 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

torch.manual_seed(0)

ARGS = {
    'num_chains': 2,
    'num_visibles': 4,
    'num_hiddens': 3,
    'device': torch.device('cpu')
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
init_parameters Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/binary/functions.py
code served (permissive licence) · get_code("57a08ed97ab994a1")
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 dict. 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

torch.manual_seed(0)

# Create a small binary data tensor (batch_size=2, num_visibles=4)
# Values should be between 0 and 1 for frequencies
data = torch.tensor([
    [0.1, 0.9, 0.3, 0.7],
    [0.2, 0.8, 0.4, 0.6]
], dtype=torch.float32)

num_visibles = 4
num_hiddens = 3
device = torch.device('cpu')

ARGS = {
    'data': data,
    'num_visibles': num_visibles,
    'num_hiddens': num_hiddens,
    'device': device
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_params Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/io.py
code served (permissive licence) · get_code("326a513148daf652")
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 dict. 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 h5py
import tempfile
import os

torch.manual_seed(0)

# Create a temporary HDF5 file with RBM model parameters
temp_dir = tempfile.mkdtemp()
fname = os.path.join(temp_dir, "rbm_model.h5")

with h5py.File(fname, 'w') as f:
    # Create first checkpoint
    grp0 = f.create_group('update_0')
    grp0.create_dataset('weight_matrix', data=torch.randn(4, 3).numpy())
    grp0.create_dataset('vbias', data=torch.randn(4).numpy())
    grp0.create_dataset('hbias', data=torch.randn(3).numpy())
    
    # Create second checkpoint
    grp1 = f.create_group('update_5')
    grp1.create_dataset('weight_matrix', data=torch.randn(4, 3).numpy())
    grp1.create_dataset('vbias', data=torch.randn(4).numpy())
    grp1.create_dataset('hbias', data=torch.randn(3).numpy())

ARGS = {
    'fname': fname,
    'device': torch.device('cpu'),
    'checkpoint': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
sample_hiddens Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/binary/sampling.py
code served (permissive licence) · get_code("cc2b7a54dbdbf7fd")
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 dict. 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

torch.manual_seed(0)

# Construct chains dictionary with visible layer and hidden layer mean/sample
chains = {
    'v': torch.randn(2, 4),  # batch_size=2, visible_dim=4
    'mh': torch.zeros(2, 3),  # batch_size=2, hidden_dim=3 (will be overwritten)
    'h': torch.zeros(2, 3),   # batch_size=2, hidden_dim=3 (will be overwritten)
}

# Construct params dictionary with model parameters
params = {
    'hbias': torch.randn(3),           # hidden_dim=3
    'weight_matrix': torch.randn(4, 3),  # visible_dim=4, hidden_dim=3
}

# Construct ARGS
ARGS = {
    'chains': chains,
    'params': params,
    'beta': 1.0,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
sample_state Ran
ran on a synthesized input
AurelienDecelle/TorchRBM/rbm/binary/sampling.py
code served (permissive licence) · get_code("14fbad21f76df895")
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 dict. 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

torch.manual_seed(0)

# Define parameters for the RBM model
# weight_matrix connects visible to hidden layer (n_visible x n_hidden)
# hbias is for hidden layer (n_hidden,)
# vbias is for visible layer (n_visible,)
n_visible = 4
n_hidden = 3
batch_size = 2

params = {
    'weight_matrix': torch.randn(n_visible, n_hidden),
    'hbias': torch.randn(n_hidden),
    'vbias': torch.randn(n_visible),
}

# Initialize chains with visible states
# v: visible layer states (batch_size x n_visible)
chains = {
    'v': torch.bernoulli(torch.ones(batch_size, n_visible) * 0.5),
}

# Number of Gibbs sampling steps
gibbs_steps = 5

# Inverse temperature parameter
beta = 1.0

ARGS = {
    'chains': chains,
    'params': params,
    'gibbs_steps': gibbs_steps,
    'beta': beta,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
compute_U Not yet run
unverified (harvested, no recorded run)
AurelienDecelle/TorchRBM/rbm/custom_fn.py
code served (permissive licence) · get_code("b72a6e53e13acc13")
How it ran

no invocation recorded.

compute_gradient Not yet run
unverified (harvested, no recorded run)
AurelienDecelle/TorchRBM/rbm/binary/grad.py
code served (permissive licence) · get_code("7c0b3558a3e52f2f")
How it ran

no invocation recorded.

get_checkpoints Not yet run
unverified (harvested, no recorded run)
AurelienDecelle/TorchRBM/rbm/utils.py
code served (permissive licence) · get_code("07cd4647fea9a351")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
AurelienDecelle/TorchRBM/rbm/io.py
code served (permissive licence) · get_code("5119b421a1e356a4")
How it ran

no invocation recorded.

one_hot Not yet run
unverified (harvested, no recorded run)
AurelienDecelle/TorchRBM/rbm/custom_fn.py
code served (permissive licence) · get_code("f2786712ec765b2c")
How it ran

no invocation recorded.

sample_visibles Not yet run
unverified (harvested, no recorded run)
AurelienDecelle/TorchRBM/rbm/binary/sampling.py
code served (permissive licence) · get_code("f328caf2bd83dfaa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 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 21 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

Training Restricted Boltzmann Machines (RBMs) has been challenging for a long time due to the difficulty of computing precisely the log-likelihood gradient. Over the past decades, many works have proposed more or less successful training recipes but without studying the crucial quantity of the problem: the mixing time, i.e. the number of Monte Carlo iterations needed to sample new configurations from a model. In this work, we show that this mixing time plays a crucial role in the dynamics and stability of the trained model, and that RBMs operate in two well-defined regimes, namely equilibrium and out-of-equilibrium, depending on the interplay between this mixing time of the model and the number of steps, k, used to approximate the gradient. We further show empirically that this mixing time increases with the learning, which often implies a transition from one regime to another as soon as k becomes smaller than this time. In particular, we show that using the popular k (persistent) contrastive divergence approaches, with k small, the dynamics of the learned model are extremely slow and often dominated by strong out-of-equilibrium effects. On the contrary, RBMs trained in equilibrium display faster dynamics, and a smooth convergence to dataset-like configurations during the sampling. Finally we discuss how to exploit in practice both regimes depending on the task one aims to fulfill: (i) short k can be used to generate convincing samples in short learning times, (ii) large k (or increasingly large) is needed to learn the correct equilibrium distribution of the RBM. Finally, the existence of these two operational regimes seems to be a general property of energy based models trained via likelihood maximization. Preprint. Under review.

For agents

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

get_harvested_code_for_paper("2105.13889")
get_code_for_paper("2105.13889")
have("2105.13889")

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

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

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

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

Connect an agent — have() is free.