Combining sampling and attractor dynamics in spiking models of head direction systems.
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
Jupyter notebook · 57 lines · 1.9 KB · GPL-3.0
- # %% [markdown]
- # # Combining Sampling Methods with Attractor Dynamics in Spiking Models of Head-Direction Systems
- # ## by Vojko Pjanovic, Jacob Zavatone-Veth, Paul Masset, Sander Keemink & Michele Nardin.
- #
- # Code written by Vojko Pjanovic and Michele Nardin.
- #
- # This notebook includes the code for Fig. 1 panels B and C.
- # %% [markdown]
- # ## Panel B:
- # #### For increasing noise levels on the encoding of the angular velocity, the posterior distribution 𝑃 (𝜔𝑡 |𝝈𝑡 ) will show more and more uncertainty.
- #
- # The posterior over Poisson spikes is a Gumbel distribution:
- # $P(\omega_t | \sigma_t) \propto e^{-e^{\beta \omega_t}}e^{\beta \omega_t \sigma_t}$
- # %%
- import numpy as np
- import matplotlib.pyplot as plt
- # plot pdf of gumbel distribution
- omega = 1
- np.random.seed(0)
- for beta in [0.5, 1, 3]:
- kernel = np.random.poisson(np.exp(beta*omega))
- x = np.linspace(-3,5,1000)
- plt.figure(figsize=(2,2))
- y = np.exp(beta*kernel*x - np.exp(beta*x))
- plt.plot(x,y)
- plt.axis('off')
- plt.title(f'beta={beta}, kernel={kernel}')
- plt.show()
- # %% [markdown]
- #
- # ## Panel C:
- # #### Estimating true density and statistics through sampling (colorful arrows: samples, grey line: samples histogram, blue line: true distribution).
- # %%
- # sample 20 samples from gumbel distribution with beta = 1
- # then plot these samples as small arrows, each of different color, on the x axis
- np.random.seed(13)
- samples = np.random.gumbel(0,1,12)
- plt.figure(figsize=(2,2))
- # plot pdf first
- x = np.linspace(-3,5,1000)
- y = np.exp(-x - np.exp(-x))
- plt.plot(x,y,label='true density')
- plt.plot(np.linspace(-3,5,1000),np.zeros(1000),'k')
- for i,sample in enumerate(samples):
- plt.arrow(sample,-0.11,0,0.1,color=plt.cm.viridis(i/len(samples)),head_width=0.1,head_length=0.01,label='sample '+str(i))
- plt.axis('off')
- # plot the hist
- plt.hist(samples,bins=np.linspace(-3,5,8),density=True,color='k',histtype='step',label='samples hist.',alpha=0.5)
- plt.show()
Figure1_v2.ipynb at commit 45a30d4, under GPL-3.0 · at the source
Overview
- Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, Virginia, United States of America
- Department of Machine Learning and Neural Computing, Donders Institute for Brain, Cognition and Behaviour, Radboud University, Nijmegen, Netherlands
- Society of Fellows and Center for Brain Science, Harvard University, Cambridge, Massachusetts, United States of America
- Department of Psychology, McGill University, Montréal, Québec, Canada
- Mila - Quebec Artificial Intelligence Institute, Montréal, Québec, Canada
Abstract
Neural populations can maintain stable representations of navigation-related variables while integrating uncertain sensory signals. Experimental evidence showed that the precision of head-direction (HD) representations in flies and mice depends on the reliability of sensory cues, highlighting the influence of input uncertainty in attractor-based neural circuits. How do neural dynamics maintain stability while computing under uncertainty? Here, we propose a spiking neural network that unifies two principles — stability through attraction and uncertainty through fluctuation — and reinterpret the HD circuit as an uncertainty-aware integrator rather than a deterministic compass. Specifically, the network uses sampling-based probabilistic inference, where a neural population represents input uncertainty by rapidly fluctuating among likely hypotheses about the world while preserving a stable representation of head direction along an attractor manifold. This formulation suggests why a classical HD “bump” becomes less precise, namely due to rapid fluctuations, reflecting the uncertainty in angular velocity inputs. Our implementation yields experimentally testable predictions: correlated subthreshold voltage fluctuations, multi-timescale nonlinear interaction patterns, and characteristic statistics of bump movement. By combining probabilistic inference with attractor dynamics within one single circuit, our framework suggests how neural populations across species can represent an estimate and its uncertainty through fluctuations while maintaining stability, which could be a general principle for uncertainty-aware computation in noisy biological systems.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
michnard/sampl_attract_HD
45a30d440031ce4e728226ee64a2ebb7d79a6de8, 20 January 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
7 files
- Figure1_v2.ipynb, Jupyter, 57 lines
- Figure2_v3.ipynb, Jupyter, 174 lines
- Figure3_v2.ipynb, Jupyter, 196 lines
- Figure4_v2.ipynb, Jupyter, 256 lines
- funcs.py, Python, 56 lines
- LICENSE, License, 674 lines
- README.md, Text, 9 lines
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;
- 5 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- 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
No dataset and no data link were found in the paper.
Data Availability
The code to generate the simulations and reproduce the analyses in the main figures is available at https://
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, 5 authors, 10 MeSH terms, 6 funders, 79 references.
Cite
This paper
Pjanovic, V., Zavatone-Veth, J. A., Masset, P., Keemink, S. W., & Nardin, M. (2026). Combining sampling and attractor dynamics in spiking models of head direction systems. PLoS computational biology, 22(7), e1014577. https://
BibTeX
@article{pjanovic2026com
author = {Pjanovic, Vojko and Zavatone-Veth, Jacob A. and Masset, Paul and Keemink, Sander W. and Nardin, Michele},
title = {{Combining sampling and attractor dynamics in spiking models of head direction systems}},
journal = {PLoS computational biology},
year = {2026},
month = jul,
volume = {22},
number = {7},
pages = {e1014577},
publisher = {PLOS},
issn = {1553-734X},
doi = {10.1371/
url = {https://
pmid = {42531351},
pmcid = {PMC13450861}
}
RIS
TY - JOUR
AU - Pjanovic, Vojko
AU - Zavatone-Veth, Jacob A.
AU - Masset, Paul
AU - Keemink, Sander W.
AU - Nardin, Michele
TI - Combining sampling and attractor dynamics in spiking models of head direction systems
T2 - PLoS computational biology
J2 - PLoS Comput Biol
PY - 2026
DA - 2026/
VL - 22
IS - 7
SP - e1014577
SN - 1553-734X
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "Combining sampling and attractor dynamics in spiking models of head direction systems",
"container-title": "PLoS computational biology",
"author": [
{
"family": "Pjanovic",
"given": "Vojko"
},
{
"family": "Zavatone-Veth",
"given": "Jacob A."
},
{
"family": "Masset",
"given": "Paul"
},
{
"family": "Keemink",
"given": "Sander W."
},
{
"family": "Nardin",
"given": "Michele"
}
],
"container-title-short":
"volume": "22",
"issue": "7",
"page": "e1014577",
"DOI": "10.1371/
"PMID": "42531351",
"PMCID": "PMC13450861",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
30
]
]
}
}
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.1038/s41593-024-01766-5 [code]
- Maintaining and updating accurate internal representations of continuous variables with a handful of neurons.Journal: Nature neuroscienceIn common: 16 references
- [2] doi:10.1371/journal.pcbi.1011913 [code]
- Estimating orientation in natural scenes: A spiking neural network model of the insect central complex.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 12 references
- [3] doi:10.1073/pnas.2312992121 [code]
- Chaotic neural dynamics facilitate probabilistic computations through sampling.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: 13 references
- [4] doi:10.1016/j.heliyon.2024.e35458 [code]
- Synaptic ring attractor: A unified framework for attractor dynamics and multiple cues integration.Journal: HeliyonIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 11 references
- [5] doi:10.1371/journal.pcbi.1010547 [code]
- Multiple bumps can enhance robustness to noise in continuous attractor networks.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, computational, computational modeling (no new data), 11 references
- [6] doi:10.1073/pnas.2210622120 [code]
- Bayesian inference in ring attractor networks.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 11 references
- [7] doi:10.1038/s41467-026-70267-9 [code]
- Neural circuit models for evidence accumulation through choice-selective sequences.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 10 references
- [8] doi:10.1038/s41467-023-41743-3 [code]
- Sampling-based Bayesian inference in recurrent circuits of stochastic spiking neurons.Journal: Nature communicationsIn common: computational modeling (no new data), 11 references
- [9] doi:10.1038/s41467-025-63817-0 [code]
- Explicit error coding can mediate gain recalibration in continuous bump attractor networks.Journal: Nature communicationsIn common: computational, computational modeling (no new data), 10 references
- [10] doi:10.1371/journal.pcbi.1012155 [code]
- A computational model for angular velocity integration in a locust heading circuit.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 9 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 5 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:4da546ac5ffe138a…
Add the badge to the code's README
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 -->
[](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014577)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014577.svg
:target: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014577
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014577"><img src="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014577.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.
