SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.11946 · ICLR · 2022

Temporal Efficient Training of Spiking Neural Network via Gradient Re-weighting

Shanghang Zhang, Yuhang Li, Shikuang Deng, Shi Gu

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; 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/2202.11946.json · badge: /api/ran/2202.11946.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
brain-intelligence-lab/temporal_efficient_training canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
gus-lab/temporal_efficient_training marked official in Papers with Code
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
normalizex Ran
ran; our contract draft was wrong, not the code
brain-intelligence-lab/temporal_efficient_training/models/layers.py
code served (permissive licence) · get_code("027e234d17d12457")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:18:50Z). 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)

# Create a small tensor with shape (batch=2, channels=4, height=3, width=5)
tensor = torch.randn(2, 4, 3, 5)

# Create mean and std tensors with shape (channels=4,)
mean = torch.tensor([0.1, 0.2, 0.3, 0.4])
std = torch.tensor([0.5, 0.6, 0.7, 0.8])

ARGS = {
    "tensor": tensor,
    "mean": mean,
    "std": std,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (2, 4, 3, 5) — shape (2, 4, 3, 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
TET_loss Ran
ran; our contract draft was wrong, not the code
gus-lab/temporal_efficient_training/functions.py
code served (permissive licence) · get_code("e63c09a8d741cb95")
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) 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)

# outputs: tensor with shape (batch, T, ...) where T is time steps
# The function indexes outputs[:, t, ...] for each t in range(T)
# and passes it to criterion along with labels
batch_size = 2
T = 3  # number of time steps
num_classes = 4

outputs = torch.randn(batch_size, T, num_classes)

# labels: passed to criterion(outputs[:, t, ...], labels)
# For a typical classification criterion like CrossEntropyLoss,
# labels should have shape (batch_size,) with class indices
labels = torch.randint(0, num_classes, (batch_size,))

# criterion: called as criterion(outputs[:, t, ...], labels)
# outputs[:, t, ...] has shape (batch_size, num_classes)
# Standard choice is CrossEntropyLoss
criterion = nn.CrossEntropyLoss()

# means: used in torch.zeros_like(outputs).fill_(means)
# fill_ expects a scalar value
means = 0.5

# lamb: scalar parameter for weighting
lamb = 0.3

ARGS = {
    "outputs": outputs,
    "labels": labels,
    "criterion": criterion,
    "means": means,
    "lamb": lamb,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
add_dimention Ran
ran; our contract draft was wrong, not the code
brain-intelligence-lab/temporal_efficient_training/models/layers.py
code served (permissive licence) · get_code("685a0742dceb815a")
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) and returned Tensor, ndim 5, dtype family float, shape (2, 6, 4, 3, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, channels=4, height=3, width=5)
# The function calls unsqueeze_(1) which adds a dimension at position 1
# Then repeat(1, T, 1, 1, 1) repeats along that new dimension
x = torch.randn(2, 4, 3, 5)

# T is the number of times to repeat along the new dimension
T = 6

ARGS = {
    "x": x,
    "T": T,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 5, dtype family float, shape (2, 6, 4, 3, 5) — shape (2, 6, 4, 3, 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
test Ran
ran, honoured the contract we drafted
brain-intelligence-lab/temporal_efficient_training/main_training_parallel.py
code served (permissive licence) · get_code("0f238aceb8acee39")
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) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

# Build a minimal model that:
# - has eval() method
# - takes inputs and returns outputs
# - outputs have shape (batch, num_classes, ...) so .mean(1) works
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        # x shape: (batch, 4)
        # output shape: (batch, 3, 2) so mean(1) gives (batch, 2)
        out = self.linear(x)  # (batch, 3)
        out = out.unsqueeze(2).expand(-1, -1, 2)  # (batch, 3, 2)
        return out

model = MinimalModel()
model.to(device)

# Build a minimal test_loader as list of (inputs, targets) tuples
# Each batch: inputs shape (2, 4), targets shape (2,)
test_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([1, 0])),
    (torch.randn(2, 4), torch.tensor([0, 1])),
]

ARGS = {
    'model': model,
    'test_loader': test_loader,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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

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, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 1 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
normalizex 3 other papers
3 later
2304.13098 (2023-04)
Uncovering the Representation of Spiking Neural Networks Trained with Surrogate Gradient
2308.06582 (2023-08)
Gated Attention Coding for Training High-performance and Efficient Spiking Neural Networks
aaai_27804 (2024 (year only))
Enhancing the Robustness of Spiking Neural Networks with Stochastic Gating Mechanisms
TET_loss
brick of this paper's assembly: entry
2 other papers
2 later
2304.13098 (2023-04)
Uncovering the Representation of Spiking Neural Networks Trained with Surrogate Gradient
2308.06582 (2023-08)
Gated Attention Coding for Training High-performance and Efficient Spiking Neural Networks
add_dimention 2 other papers
2 later
2304.13098 (2023-04)
Uncovering the Representation of Spiking Neural Networks Trained with Surrogate Gradient
2308.06582 (2023-08)
Gated Attention Coding for Training High-performance and Efficient Spiking Neural Networks

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

Repositories linked to this paper

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

Abstract

Recently, brain-inspired spiking neuron networks (SNNs) have attracted widespread research interest because of their event-driven and energy-efficient characteristics. Still, it is difficult to efficiently train deep SNNs due to the nondifferentiability of its activation function, which disables the typically used gradient descent approaches for traditional artificial neural networks (ANNs). Although the adoption of surrogate gradient (SG) formally allows for the back-propagation of losses, the discrete spiking mechanism actually differentiates the loss landscape of SNNs from that of ANNs, failing the surrogate gradient methods to achieve comparable accuracy as for ANNs. In this paper, we first analyze why the current direct training approach with surrogate gradient results in SNNs with poor generalizability. Then we introduce the temporal efficient training (TET) approach to compensate for the loss of momentum in the gradient descent with SG so that the training process can converge into flatter minima with better generalizability. Meanwhile, we demonstrate that TET improves the temporal scalability of SNN and induces a temporal inheritable training for acceleration. Our method consistently outperforms the SOTA on all reported mainstream datasets, including CIFAR-10/100 and ImageNet. Remarkably on DVS-CIFAR10, we obtained 83% top-1 accuracy, over 10% improvement compared to existing state of the art. Codes are available at https://github.com/Gus-Lab/temporal_ efficient_training.

For agents

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

get_harvested_code_for_paper("2202.11946")
get_code_for_paper("2202.11946")
have("2202.11946")

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

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

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

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

Connect an agent — have() is free.