SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.12362 · 2020

Rescuing neural spike train models from bad MLE

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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 9 have no contract verdict; 0 failures of our instrument; 0 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/2010.12362.json · badge: /api/ran/2010.12362.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
diegoarri91/mmd-glm canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
MMD Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/metrics.py
code served (permissive licence) · get_code("be2d9936016ac934")
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
import torch.nn as nn

torch.manual_seed(0)

# Define a simple kernel function
def kernel_fn(t, x, y, **kwargs):
    """Simple RBF-like kernel"""
    # x shape: (feature_dim, n_samples)
    # y shape: (feature_dim, n_samples)
    # Returns: (n_samples_x, n_samples_y) gramian
    n_x = x.shape[1]
    n_y = y.shape[1]
    gramian = torch.zeros(n_x, n_y)
    for i in range(n_x):
        for j in range(n_y):
            diff = torch.sum((x[:, i] - y[:, j]) ** 2)
            gramian[i, j] = torch.exp(-diff)
    return gramian

# Define a simple feature map function
def phi_fn(t, x, **kwargs):
    """Simple feature map that returns features"""
    # x shape: (feature_dim, n_samples)
    # Returns: (feature_dim, n_samples) feature representation
    return x

# Create small sample data tensors
# Shape: (feature_dim=4, n_samples=2)
s1 = torch.randn(4, 2)
s2 = torch.randn(4, 2)

# Simple time parameter (can be anything, just passed through)
t = torch.tensor(0.0)

ARGS = {
    "t": t,
    "s1": s1,
    "s2": s2,
    "phi": phi_fn,
    "kernel": kernel_fn,
    "biased": False,
}
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
bernoulli_log_likelihood_pp Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/metrics.py
code served (permissive licence) · get_code("37092e1653765120")
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 float, 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
import numpy as np

torch.manual_seed(0)

# The function expects mask_spikes to be a tensor
# It uses: torch.sum(), .numel(), division, torch.log(), .item()
# So we need a boolean or numeric tensor

mask_spikes = torch.bernoulli(torch.full((2, 4), 0.5))

ARGS = {
    "mask_spikes": mask_spikes
}
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 float, 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_arg_support Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/utils.py
code served (permissive licence) · get_code("694d2a8682a48f0f")
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, ndim 1, dtype family int; 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 numpy as np

# Analyze the function:
# - dt: a scalar (sampling interval), used in division
# - t_support: a tuple/list with two elements [t_support[0], t_support[1]], used for indexing
# - t0: a scalar with default value 0, used in subtraction

ARGS = {
    "dt": 0.1,
    "t_support": (-0.5, 1.0),
    "t0": 0.0
}
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 tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
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_dt Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/utils.py
code served (permissive licence) · get_code("6982697d113f1753")
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 float64, ndim 0, 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 numpy as np

# Create a 1d array with time values
# Using a case with more than 20 elements to test the median calculation
t = np.linspace(0, 100, 50)  # 50 time points from 0 to 100

ARGS = {
    "t": t
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
ker_schoenberg Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/kernels.py
code served (permissive licence) · get_code("c46c2f18a211958c")
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, 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 torch

torch.manual_seed(0)

# Create small spike mask tensors
# mask_spikes1: shape (time_steps, num_neurons1)
# mask_spikes2: shape (time_steps, num_neurons2)
mask_spikes1 = torch.randn(3, 4)
mask_spikes2 = torch.randn(3, 5)

t = None  # Not used in the function body

sd2 = 1.0

ARGS = {
    't': t,
    'mask_spikes1': mask_spikes1,
    'mask_spikes2': mask_spikes2,
    'sd2': sd2
}
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, 5) — shape (4, 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
phi_autocor Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/kernels.py
code served (permissive licence) · get_code("41f625c32eed7ee5")
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 (18, 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 torch
import numpy as np
from scipy.signal import fftconvolve

torch.manual_seed(0)

# Create a small spike raster as a numpy array
# The function expects mask_spikes to have a .numpy() method, so we pass a torch tensor
spike_data = np.random.rand(10, 4)  # 10 time steps, 4 neurons
mask_spikes = torch.from_numpy(spike_data).float()

# Define arguments
ARGS = {
    't': 0,  # t is not actually used in the function body
    'mask_spikes': mask_spikes,
    'padding': 250
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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 (18, 4) — shape (18, 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
phi_autocor_history Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/kernels.py
code served (permissive licence) · get_code("a122e238b7289a4a")
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 (250, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal model that has attribute 'b'
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.b = torch.tensor([0.1, 0.2, 0.3, 0.4])

model = MinimalModel()

# Create time vector t with length T
t = torch.linspace(0, 1, 5)

# Create r tensor with shape (T, D) where D is the number of features
# T=5 matches len(t), D=4 matches model.b dimensions
r = torch.randn(5, 4)

ARGS = {
    "t": t,
    "r": r,
    "model": model,
    "padding": 250
}
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 (250, 4) — shape (250, 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
plot_spiketrain Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/utils.py
code served (permissive licence) · get_code("df4fb3b42d969a5e")
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 Axes. 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 matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np

# Create sample spike train data
# t: time array
# mask_spikes: 2D boolean array where True indicates a spike
#   - First dimension indexes time points
#   - Second dimension indexes neurons/channels

np.random.seed(0)

# Create time array from 0 to 100 ms with 50 time steps
t = np.linspace(0, 100, 50)

# Create a 2D mask of spikes: 50 time points x 3 neurons
# Randomly place some spikes (True values)
mask_spikes = np.random.rand(50, 3) > 0.8

ARGS = {
    't': t,
    'mask_spikes': mask_spikes,
    'ax': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes 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
poisson_log_likelihood_poisson_process Ran
ran on a synthesized input
diegoarri91/mmd-glm/mmdglm/metrics.py
code served (permissive licence) · get_code("0371b735e6d3369f")
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 float64, ndim 0, 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 numpy as np

# Construct arguments for poisson_log_likelihood_poisson_process
# The function expects:
# - dt: scalar float (time step)
# - mask_spikes: boolean array of shape (time_steps, n_neurons)
# - u: array of log-likelihood values, same shape as mask_spikes
# - r: array of rates, shape (time_steps, n_neurons) or similar

# Create a small time series with spike data
time_steps = 5
n_neurons = 3

# dt: time step
dt = 0.01

# mask_spikes: boolean mask indicating spike times
# Shape: (time_steps, n_neurons)
mask_spikes = np.array([
    [True, False, True],
    [False, True, False],
    [True, True, False],
    [False, False, True],
    [True, False, False]
], dtype=bool)

# u: log-likelihood values at each time step and neuron
# Same shape as mask_spikes
u = np.random.randn(time_steps, n_neurons)

# r: rates at each time step and neuron
# Same shape as mask_spikes
r = np.abs(np.random.randn(time_steps, n_neurons)) + 0.5

ARGS = {
    "dt": dt,
    "mask_spikes": mask_spikes,
    "u": u,
    "r": r
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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

Also present in other papers' code

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

The standard approach to fitting an autoregressive spike train model is to maximize the likelihood for one-step prediction. This maximum likelihood estimation (MLE) often leads to models that perform poorly when generating samples recursively for more than one time step. Moreover, the generated spike trains can fail to capture important features of the data and even show diverging firing rates. To alleviate this, we propose to directly minimize the divergence between neural recorded and model generated spike trains using spike train kernels. We develop a method that stochastically optimizes the maximum mean discrepancy induced by the kernel. Experiments performed on both real and synthetic neural data validate the proposed approach, showing that it leads to well-behaving models. Using different combinations of spike train kernels, we show that we can control the trade-off between different features which is critical for dealing with model-mismatch.

For agents

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

get_harvested_code_for_paper("2010.12362")
get_code_for_paper("2010.12362")
have("2010.12362")

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

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

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

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

Connect an agent — have() is free.