SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.07211 · 2022

Human-Level Control through Directly-Trained Deep Spiking Q-Networks

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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 7 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2201.07211.json · badge: /api/ran/2201.07211.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
aptx395/deep-spiking-q-networks canonical (classifier label)
classifier basis not recorded on the link
7 ran · 4 no recorded run
FunctionStatusWhere it lives
data_based_normalization Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/conversion/conversion.py
code served (permissive licence) · get_code("1939ee0f30207e98")
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 SimpleNet. 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
import numpy as np

torch.manual_seed(0)

# Build a small neural network
class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.fc1 = nn.Linear(4, 3)
        self.relu1 = nn.ReLU()
        self.fc2 = nn.Linear(3, 2)
        
    def forward(self, x):
        x = self.fc1(x)
        x = self.relu1(x)
        x = self.fc2(x)
        return x

# Build a network with Sequential module
class NetWithSequential(nn.Module):
    def __init__(self):
        super(NetWithSequential, self).__init__()
        self.layers = nn.Sequential(
            nn.Linear(4, 3),
            nn.ReLU(),
            nn.Linear(3, 2)
        )
        
    def forward(self, x):
        return self.layers(x)

# Create a simple ANN
ann = SimpleNet()

# Create small data tensor: batch_size=2, feature_dim=4
data = torch.randn(2, 4)

# Set percentile parameter
percentile = 99.9

ARGS = {
    'ann': ann,
    'data': data,
    'percentile': percentile
}
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 SimpleNet — a SimpleNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleNet 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
get_square_weights Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/utils.py
code served (permissive licence) · get_code("f3eea1e5232b84f5")
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 (6, 6) 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
from torch import Tensor

torch.manual_seed(0)

# The function expects:
# - weights: a 2D tensor where weights.size(1) is the number of filters
# - n_sqrt: an integer representing the square root of number of filters
# - side: either an int or tuple of (height, width) for filter dimensions

# Looking at the function body:
# - weights[:, n] extracts a column (filter) and reshapes it to (*side)
# - The reshaped filter must have total elements equal to side[0] * side[1]
# - n_sqrt ** 2 should be <= weights.size(1) (number of filters)

# Let's create valid arguments:
# If n_sqrt = 2, we need 2*2 = 4 filters
# If side = (3, 3), each filter has 3*3 = 9 elements
# So weights should be shape (9, 4) - 9 elements per filter, 4 filters

n_sqrt = 2
side = (3, 3)
num_filters = n_sqrt * n_sqrt  # 4 filters
filter_size = side[0] * side[1]  # 9 elements per filter

weights = torch.randn(filter_size, num_filters)

ARGS = {
    "weights": weights,
    "n_sqrt": n_sqrt,
    "side": side,
}
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 (6, 6) — shape (6, 6) 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
im2col_indices Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/utils.py
code served (permissive licence) · get_code("3df182d5ab843ec0")
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 3, dtype family float, shape (2, 18, 24) 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.functional as F

torch.manual_seed(0)

# Construct a small input tensor for im2col_indices
# Shape: (batch_size, channels, height, width) = (2, 3, 4, 5)
x = torch.randn(2, 3, 4, 5)

# Define kernel dimensions
kernel_height = 3
kernel_width = 2

# Define padding
padding = (1, 1)

# Define stride
stride = (1, 1)

# Construct the ARGS dict mapping all parameters
ARGS = {
    "x": x,
    "kernel_height": kernel_height,
    "kernel_width": kernel_width,
    "padding": padding,
    "stride": stride,
}
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 3, dtype family float, shape (2, 18, 24) — shape (2, 18, 24) 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_input Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/analysis/plotting.py
code served (permissive licence) · get_code("0c3153a7016e268e")
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 2, 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
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
from matplotlib.image import AxesImage
from typing import Tuple, List, Optional

torch.manual_seed(0)

# Create small 2D tensors for image and spike-train encoding
image = torch.rand(4, 3)  # 2D image tensor
inpt = torch.rand(4, 3)   # 2D spike-train encoding tensor

# Define ARGS dictionary with all parameters
ARGS = {
    "image": image,
    "inpt": inpt,
    "label": None,
    "axes": None,
    "ims": None,
    "figsize": (8, 4)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — 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
plot_spikes Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/analysis/plotting.py
code served (permissive licence) · get_code("26504be2cb9569ee")
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 2, 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
import numpy as np
import matplotlib.pyplot as plt

torch.manual_seed(0)

# Create spike data: Dict[str, torch.Tensor]
# Spike data has shape [time, n_1, ..., n_k]
# We'll create two groups with different shapes
spikes_data = {
    "layer1": torch.randint(0, 2, (10, 4, 3), dtype=torch.float32),  # [time=10, spatial=4x3]
    "layer2": torch.randint(0, 2, (10, 6,), dtype=torch.float32),    # [time=10, neurons=6]
}

# Time range: (start, end)
time_range = (2, 8)

# Neuron ranges: Dict[str, Tuple[int, int]]
n_neurons_range = {
    "layer1": (0, 10),  # neurons 0-10 (but layer1 has 12 total after flattening)
    "layer2": (1, 5),   # neurons 1-5 (but layer2 has 6 total)
}

# Create matplotlib figure and axes for re-drawing test
fig, axes_list = plt.subplots(2, 1, figsize=(8.0, 4.5))
axes_list = list(axes_list)

# Create initial ims list with scatter plot collections
ims_list = []
for ax in axes_list:
    ims_list.append(ax.scatter([], [], s=1))

ARGS = {
    "spikes": spikes_data,
    "time": time_range,
    "n_neurons": n_neurons_range,
    "ims": ims_list,
    "axes": axes_list,
    "figsize": (8.0, 4.5),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — 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
plot_weights Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/analysis/plotting.py
code served (permissive licence) · get_code("59fc691139936746")
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 AxesImage. 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 matplotlib.pyplot as plt
from matplotlib.image import AxesImage

torch.manual_seed(0)

# Create a small weight matrix tensor
weights = torch.randn(4, 3)

# Create optional AxesImage (initially None, but we'll also show how to create one)
im = None

# Define all arguments for plot_weights
ARGS = {
    'weights': weights,
    'wmin': 0.0,
    'wmax': 1.0,
    'im': im,
    'figsize': (5, 5),
    'cmap': 'hot_r'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, mpl_toolkits, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AxesImage — a AxesImage output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AxesImage 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
policy Ran
ran on a synthesized input
aptx395/deep-spiking-q-networks/conversion_based_snn/convert.py
code served (permissive licence) · get_code("24aee32b25d3bfeb")
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 torch
import numpy as np

torch.manual_seed(0)

# q_values: a tensor of Q-values that torch.argmax will be called on
q_values = torch.tensor([0.5, 2.3, 1.1, 0.8])

# eps: exploration parameter (float between 0 and 1)
eps = 0.1

ARGS = {
    "q_values": q_values,
    "eps": eps
}
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 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
col2im_indices Not yet run
unverified (harvested, no recorded run)
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/utils.py
code served (permissive licence) · get_code("50f9816002db19dc")
How it ran

no invocation recorded.

make_atari Not yet run
unverified (harvested, no recorded run)
aptx395/deep-spiking-q-networks/environment/atari_wrappers.py
code served (permissive licence) · get_code("a70a2154eb543432")
How it ran

no invocation recorded.

plot_weights_movie Not yet run
unverified (harvested, no recorded run)
aptx395/deep-spiking-q-networks/conversion_based_snn/bindsnet/analysis/visualization.py
code served (permissive licence) · get_code("8e21901b11d8151c")
How it ran

no invocation recorded.

wrap_deepmind Not yet run
unverified (harvested, no recorded run)
aptx395/deep-spiking-q-networks/environment/atari_wrappers.py
code served (permissive licence) · get_code("2dc1687fabf93833")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 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.

FunctionAlso present inEarliest-datedOthers named
wrap_deepmind 4 other papers
4 dated earlier
1509.06461 (2015-09)
Deep Reinforcement Learning with Double Q-learning
1905.02363 (2019-05)
Dimension-Wise Importance Sampling Weight Clipping for Sample-Efficient Reinforcement Learning
2006.04061 (2020-06)
Dual Policy Distillation
and 1 more not named here
make_atari 1 other paper
1 dated earlier
1509.06461 (2015-09)
Deep Reinforcement Learning with Double Q-learning

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-21.

Repositories linked to this paper

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

Abstract

As the third-generation neural networks, Spiking Neural Networks (SNNs) have great potential on neuromorphic hardware because of their high energy-efficiency. However, Deep Spiking Reinforcement Learning (DSRL), i.e., the Reinforcement Learning (RL) based on SNNs, is still in its preliminary stage due to the binary output and the non-differentiable property of the spiking function. To address these issues, we propose a Deep Spiking Q-Network (DSQN) in this paper. Specifically, we propose a directly-trained deep spiking reinforcement learning architecture based on the Leaky Integrate-and-Fire (LIF) neurons and Deep Q-Network (DQN). Then, we adapt a direct spiking learning algorithm for the Deep Spiking Q-Network. We further demonstrate the advantages of using LIF neurons in DSQN theoretically. Comprehensive experiments have been conducted on 17 top-performing Atari games to compare our method with the state-of-the-art conversion method. The experimental results demonstrate the superiority of our method in terms of performance, stability, robustness and energy-efficiency. To the best of our knowledge, our work is the first one to achieve state-of-the-art performance on multiple Atari games with the directly-trained SNN.

For agents

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

get_harvested_code_for_paper("2201.07211")
get_code_for_paper("2201.07211")
have("2201.07211")

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

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

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

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

Connect an agent — have() is free.