Combining sampling and attractor dynamics in spiking models of head direction systems.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: 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.1371/journal.pcbi.1014432 [code]
- Spiking neurons as predictive controllers of linear systems.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, computational, computational modeling (no new data), 4 references
- [2] doi:10.1038/s41467-026-74460-8 [code]
- Spike-based alignment learning solves the weight transport problem.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 4 references
- [3] doi: [code]
- Limit-Cycle Proliferation Under Parametric Delayed Feedback in a Conductance-Based Neuron: Bifurcation Landscape, Orbit Catalog, and Capacity AnalysisJournal: Entropy (Basel, Switzerland)In common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 4 references
- [4] doi:10.1126/sciadv.aeh7220 [code]
- Central complex representations of self-movement are sufficient to compute wind direction in flight.Journal: Science advancesIn common: SciPy, Matplotlib, NumPy, 4 references
- [5] doi:10.1038/s41586-026-10827-7 [code]
- A vector-based strategy for olfactory navigation in Drosophila.Journal: NatureIn common: SciPy, Matplotlib, NumPy, 4 references
- [6] doi:10.1038/s41467-026-75924-7 [code]
- Data-driven reduced modeling of neural dynamics.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), 3 references
- [7] doi:10.1038/s42256-026-01254-4 [code]
- Neural sampling from cognitive maps enables goal-directed imagination and planning.Journal: Nature machine intelligenceIn common: Matplotlib, NumPy, computational modeling (no new data), 3 references
- [8] doi:10.1038/s41586-026-10735-w [code]
- Distributed control circuits across a brain-and-cord connectome.Journal: NatureIn common: SciPy, Matplotlib, NumPy, 3 references
- [9] doi: [code]
- Going deeper with morphologically detailed neural networks by simulation-based gradient propagationJournal: Frontiers in computational neuroscienceIn common: SciPy, Matplotlib, NumPy, computational, computational modeling (no new data), 2 references
- [10] doi:10.1371/journal.pcbi.1014585 [code]
- Decoding behavior with minimal and interpretable agent models.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, computational modeling (no new data), mouse, 2 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 its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
