OSCR

Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales.

Code ↔ Paper

1 match between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 1 match
  1. [1] § Methods › Network architecture ↔ cornet/cornet_rt.py, lines 28 to 97 · score 0.53 · Gaussian noise, CORnet RT, pre, model · block oscr:b:5BPB6AYSSCMP4-F · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 170 lines · 6.6 KB · no license · 1 match

  1. from collections import OrderedDict
  2. import torch
  3. from torch import nn
  4. import numpy as np
  5. HASH = '933c001c'
  6. torch.backends.cudnn.deterministic = False
  7. torch.backends.cudnn.enabled = False
  8. class Flatten(nn.Module):
  9. """
  10. Helper module for flattening input tensor to 1-D for the use in Linear modules.
  11. """
  12. def forward(self, x):
  13. return x.view(x.size(0), -1)
  14. class Identity(nn.Module):
  15. """
  16. Helper module that stores the current tensor. Useful for accessing by name.
  17. """
  18. def forward(self, x):
  19. return x
  20. class CORblock_RT(nn.Module):
  21. def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, out_shape=None, α=0.9, β=0.5, γ=0.9, noise_scale=0):
  22. super().__init__()
  23. self.in_channels = in_channels
  24. self.out_channels = out_channels
  25. self.out_shape = out_shape
  26. self.noise_scale = noise_scale
  27. self.conv_input = nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size,
  28. stride=stride, padding=kernel_size // 2)
  29. self.norm_input = nn.GroupNorm(32, out_channels)
  30. self.nonlin_input = nn.ReLU(inplace=True)
  31. self.conv1 = nn.Conv2d(out_channels, out_channels,
  32. kernel_size=3, padding=1, bias=False)
  33. self.norm1 = nn.GroupNorm(32, out_channels)
  34. self.nonlin1 = nn.ReLU(inplace=True)
  35. self._last_pre_relu_state = None
  36. self._last_adaptive_state = None
  37. self.output = Identity() # for easy access to this block's output
  38. self.β = β
  39. self.γ = γ
  40. self.α = α
  41. def forward(self, inp=None, state=None, s=None, timestep=0, output=None, batch_size=None, alpha=0.00001):
  42. # Ensure all tensors are on the same device as the model
  43. device = next(self.conv_input.parameters()).device
  44. if inp is None: # at t=0, there is no input yet except to V1
  45. inp = torch.zeros([batch_size, self.out_channels, self.out_shape, self.out_shape], device=device)
  46. else:
  47. inp = inp.to(device)
  48. inp = self.conv_input(inp)
  49. inp = self.norm_input(inp)
  50. inp = self.nonlin_input(inp)
  51. if state is None: # at t=0, state is initialized to zeros
  52. state = torch.zeros([batch_size, self.out_channels, self.out_shape, self.out_shape], device=device)
  53. if timestep == 0:
  54. s = torch.zeros([batch_size, self.out_channels, self.out_shape, self.out_shape], device=device)
  55. # Generate Gaussian noise (mean=0, std=1) and scale it
  56. gaussian_noise = torch.randn(inp.size(), device=device) # Gaussian noise ~ N(0, 1)
  57. scaled_random_tensor = gaussian_noise * self.noise_scale * alpha
  58. # Update adaptive state `s`
  59. if timestep > 0:
  60. s = self.α * s + (1 - self.α) * output
  61. if output is None:
  62. output = torch.zeros_like(inp)
  63. x_adjusted = inp -(self.β * s)
  64. #x_adjusted = inp + output
  65. x = self.conv1(x_adjusted)
  66. x = self.norm1(x)
  67. # Update state
  68. if timestep == 0:
  69. state = x + scaled_random_tensor
  70. else:
  71. state = x + (1 - self.γ) * state + scaled_random_tensor
  72. state_before_relu = state.clone()
  73. self._last_pre_relu_state = state_before_relu
  74. self._last_adaptive_state = s
  75. output = self.output(self.nonlin1(state))
  76. return output, state, s, state_before_relu
  77. class CORnet_RT(nn.Module):
  78. def __init__(self, times=601):
  79. super().__init__()
  80. self.times = times
  81. self.V1 = CORblock_RT(3, 64, kernel_size=7, stride=4, out_shape=56, α=0.96, β=0., γ=0.6, noise_scale=0.7)
  82. self.V2 = CORblock_RT(64, 128, stride=2, out_shape=28, α=0.96, β=0., γ=0.5, noise_scale=0.7)
  83. self.V4 = CORblock_RT(128, 256, stride=2, out_shape=14, α=0.96, β=0., γ=0.4, noise_scale=0.7)
  84. self.IT = CORblock_RT(256, 512, stride=2, out_shape=7, α=0.96, β=0., γ=0.3, noise_scale=0.7)
  85. self.decoder = nn.Sequential(OrderedDict([
  86. ('avgpool', nn.AdaptiveAvgPool2d(1)),
  87. ('flatten', Flatten()),
  88. ('linear', nn.Linear(512, 1000))
  89. ]))
  90. def forward(self, inp, alpha=0.00001):
  91. # Get the device of the model
  92. device = next(self.V1.conv_input.parameters()).device
  93. outputs = {'inp': inp.to(device)}
  94. states = {}
  95. adaptive_states = {}
  96. state_sums = {}
  97. state_counts = {}
  98. blocks = ['inp', 'V1', 'V2', 'V4', 'IT']
  99. # Initialize the outputs, states, and adaptive states for t=0
  100. for block in blocks[1:]:
  101. if block == 'V1': # at t=0 input to V1 is the image
  102. new_output, new_state, new_s, state_before_relu = getattr(self, block)(
  103. inp[:, 0].to(device), batch_size=len(outputs['inp']))
  104. else: # at t=0 there is no input yet to V2 and up
  105. new_output, new_state, new_s, state_before_relu = getattr(self, block)(
  106. inp=None, batch_size=len(outputs['inp']))
  107. # Initialize output, state, and adaptive state tensors
  108. outputs[block] = torch.zeros((new_output.shape[0], self.times, *new_output.shape[1:]), device=device)
  109. outputs[block][:, 0, :, :, :] = new_output
  110. states[block] = torch.zeros((new_state.shape[0], self.times, *new_state.shape[1:]), device=device)
  111. states[block][:, 0] = state_before_relu
  112. adaptive_states[block] = torch.zeros((new_output.shape[0], self.times, *new_output.shape[1:]), device=device)
  113. adaptive_states[block][:, 0] = new_s
  114. # Run the forward pass for all time steps
  115. for t in range(1, self.times):
  116. for block in blocks[1:]:
  117. prev_block = blocks[blocks.index(block) - 1]
  118. prev_output = outputs[prev_block][:, t if block == 'V1' else t - 1]
  119. current_prev_output = outputs[block][:, t - 1]
  120. prev_state = states[block][:, t - 1]
  121. prev_s = adaptive_states[block][:, t - 1]
  122. # Run the forward pass of the block
  123. new_output, new_state, new_s, state_before_relu = getattr(self, block)(
  124. inp=prev_output, state=prev_state, s=prev_s, timestep=t, output=current_prev_output,
  125. batch_size=len(outputs['inp']), alpha=alpha
  126. )
  127. # Update the dictionaries
  128. outputs[block][:, t, :, :, :] = new_output
  129. states[block][:, t] = state_before_relu
  130. adaptive_states[block][:, t] = new_s
  131. out = self.decoder(outputs['IT'][:, -1])
  132. return out

cornet_rt.py at commit dfded3d, no license · at the source

Overview

Authors: Sara Varetti1, Sebastian Goldt2, Eugenio Piasini1
ORCID iDs: Eugenio Piasini
  1. Cognitive Neuroscience, International School for Advanced Studies (SISSA), Trieste, Italy
  2. Theoretical and Scientific Data Science, International School for Advanced Studies (SISSA), Trieste, Italy
Journal: PLoS computational biology, volume 22, issue 8, article e1014653
Dates: received 3 December 2025; accepted 3 August 2026; published online 27 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pcbi.1014653 · PMID 42658886 · PMCID PMC13541256 · OpenAlex W7127105578
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: computational modeling (no new data) (modality), human (organism), systems (subfield)
Methods: Spectral & time-frequency, Connectivity, Machine learning
MeSH: Models, Neurological*, Visual Cortex*, Visual Pathways*, Visual Perception*, Animals, Computational Biology, Computer Simulation, Humans, Learning, Recurrent Neural Networks (* major topic)
Topic: Visual perception and processing mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: European Union – NextGenerationEU – PNRRM4C2-I.1.1 / PRIN (2022XE8X9E); European Research Council (101166056 (Project “beyond2”), 101166056); European Union—NextGenerationEU; Italian government (EP)
Citations: not cited yet (Europe PMC); 53 references in the paper

Abstract

In vision neuroscience, the temporal dynamics of the sensory stream and of its neural representations are thought to be deeply linked to the function of the hierarchy of cortical areas that deal with object recognition, known as the visual ventral stream. Neural representations that are invariant under identity-preserving object transformations, and therefore allow for efficient learning of object identity, are theorized to emerge from a self-supervised learning process that attempts to extract “temporally stable” features from the sensory input. Conversely, invariance increases along the hierarchy, putatively implying progressively slower neural codes in higher-level areas. Recent neurophysiological evidence shows that indeed, as one moves along this cortical hierarchy, neural representations of dynamic stimuli become slower, and additionally the temporal scales of the within-trial fluctuations of these representations (called “intrinsic timescales”) increase starkly. However, while these timescale hierarchies have been reproduced in biologically grounded recurrent models, their network determinants have remained largely unexplored in image-computable models of the ventral stream. Here we investigate the temporal structure of the neural codes in a noisy, recurrent and adaptive model of the ventral visual stream. We show that, surprisingly, the organization of the representation timescales is set by the broad architectural features of the network, regardless of training, while the ordering of the intrinsic timescales across layers is sensitive to the details of the functions implemented by each layer. Our work underscores the importance of the temporal structure of the neural code as a probe for the link between structure and function in models of the vertebrate visual system.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.

Saravaretti/hierarchical-cnn-rnn

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: dfded3def434921d4c8b8b400ec636c894badadf, 30 May 2026
Languages: Python (8)
Size: 10 files, 8 scripts
Software Heritage: not archived
Found in: “Data Availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (6 files), NumPy (4 files), SciPy (2 files), h5py (1 file), Pillow (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
9 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 8 scripts, each with its path and the digest of its content;
  • 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data Availability

All stimuli used in this study are publicly available at: https://osf.io/7gteq/. The code used to generate the results and figures in this paper is publicly available at https://github.com/Saravaretti/hierarchical-cnn-rnn.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 10 MeSH terms, 4 funders, 47 references.

Cite

This paper

Varetti, S., Goldt, S., & Piasini, E. (2026). Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales. PLoS computational biology, 22(8), e1014653. https://doi.org/10.1371/journal.pcbi.1014653

BibTeX

@article{varetti2026noisy,
author = {Varetti, Sara and Goldt, Sebastian and Piasini, Eugenio},
title = {{Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales}},
journal = {PLoS computational biology},
year = {2026},
month = aug,
volume = {22},
number = {8},
pages = {e1014653},
publisher = {PLOS},
issn = {1553-734X},
doi = {10.1371/journal.pcbi.1014653},
url = {https://doi.org/10.1371/journal.pcbi.1014653},
pmid = {42658886},
pmcid = {PMC13541256}
}

RIS

TY - JOUR
AU - Varetti, Sara
AU - Goldt, Sebastian
AU - Piasini, Eugenio
TI - Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales
T2 - PLoS computational biology
J2 - PLoS Comput Biol
PY - 2026
DA - 2026/08/27
VL - 22
IS - 8
SP - e1014653
SN - 1553-734X
PB - PLOS
DO - 10.1371/journal.pcbi.1014653
UR - https://doi.org/10.1371/journal.pcbi.1014653
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pcbi.1014653",
"type": "article-journal",
"title": "Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales",
"container-title": "PLoS computational biology",
"author": [
{
"family": "Varetti",
"given": "Sara"
},
{
"family": "Goldt",
"given": "Sebastian"
},
{
"family": "Piasini",
"given": "Eugenio"
}
],
"container-title-short": "PLoS Comput Biol",
"volume": "22",
"issue": "8",
"page": "e1014653",
"DOI": "10.1371/journal.pcbi.1014653",
"PMID": "42658886",
"PMCID": "PMC13541256",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pcbi.1014653",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
27
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.64898/2026.01.30.702784
Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales
Journal: bioRxiv (preprint)
In common: OSF 7gteq, systems, 25 references, author Eugenio Piasini
[2] doi:10.3389/fncel.2022.1006703 [code]
Efficient processing of natural scenes in visual cortex.
Journal: Frontiers in cellular neuroscience
In common: NumPy, systems, 19 references, author Eugenio Piasini
[3] doi:10.1371/journal.pcbi.1012355 [code]
Signatures of hierarchical temporal processing in the mouse visual system.
Journal: PLoS computational biology
In common: h5py, SciPy, NumPy, systems, 15 references
[4] doi:10.1016/j.patter.2024.101149 [code]
Unraveling the complexity of rat object vision requires a full convolutional network and beyond.
Journal: Patterns (New York, N.Y.)
In common: 11 references
[5] doi:10.3389/fncom.2023.1207361 [code]
Local minimization of prediction errors drives learning of invariant object representations in a generative network model of visual perception.
Journal: Frontiers in computational neuroscience
In common: PyTorch, SciPy, NumPy, computational modeling (no new data), 7 references
[6] doi:10.1038/s41598-025-20245-w [code]
Recurrent issues with deep neural network models of visual recognition.
Journal: Scientific reports
In common: Pillow, PyTorch, SciPy, 1 other tool, computational modeling (no new data), 6 references
[7] doi:10.7554/elife.52599 [code]
Hierarchical temporal prediction captures motion processing along the visual pathway.
Journal: eLife
In common: h5py, PyTorch, SciPy, 1 other tool, 6 references
[8] doi:10.1371/journal.pcbi.1011506 [code]
Mouse visual cortex as a limited resource system that self-learns an ecologically-general representation.
Journal: PLoS computational biology
In common: h5py, Pillow, PyTorch, 2 other tools, systems, 5 references
[9] doi:10.1371/journal.pcbi.1012354 [code]
Probabilistic neural transfer function estimation with Bayesian system identification.
Journal: PLoS computational biology
In common: h5py, Pillow, PyTorch, 2 other tools, computational modeling (no new data), 5 references
[10] doi:10.1038/s41467-024-50310-3 [code]
Modeling short visual events through the BOLD moments video fMRI dataset and metadata.
Journal: Nature communications
In common: Pillow, PyTorch, SciPy, 1 other tool, 6 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014653.svg)](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014653)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014653.svg
   :target: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014653
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014653"><img src="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014653.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.