OSCR

Flexible navigation with neuromodulated cognitive maps.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 262 lines · 6.3 KB · no license

  1. # %%
  2. import numpy as np
  3. import random
  4. import matplotlib.pyplot as plt
  5. import mod_models as mm
  6. import mod_evolution as me
  7. import sim_evo_I as se
  8. from mod_models import logger
  9. import inputools.Trajectory as it
  10. from tqdm import tqdm
  11. %load_ext autoreload
  12. %autoreload 2
  13. # %% [markdown]
  14. # ## Setup
  15. # %% [markdown]
  16. # #### Genome
  17. # %%
  18. # parameters that are not evolved
  19. FIXED_PARAMETERS = {
  20. 'N': 9,
  21. 'Nj': 9,
  22. 'dim': 2,
  23. 'lr_min': 1e-5,
  24. 'lr_tau': 100,
  25. 'wff_const': 5.5,
  26. 'wff_max': 4.5,
  27. 'wff_min': 0.01,
  28. 'wff_tau_max': 2000,
  29. 'wff_tau_min': 50,
  30. 'tau_ff': 10,
  31. 'tau_rec': 5,
  32. 'syn_ff_tau': 10,
  33. 'syn_ff_thr': 0.5,
  34. 'rate_func_beta': 0.3,
  35. 'rate_func_alpha': 60,
  36. }
  37. # Define the genome as a dict of parameters
  38. PARAMETERS = {
  39. 'tau_u': lambda: random.randint(1, 300),
  40. 'lr_max': lambda: round(random.uniform(5e-3, 0.1), 3),
  41. 'lr_min': lambda: round(random.uniform(1e-3, 1e-6), 3),
  42. 'lr_tau': lambda: random.randint(50, 300),
  43. 'wff_const': lambda: round(random.uniform(4.0, 10.0), 3),
  44. 'wff_max': lambda: round(random.uniform(2.0, 10.0), 3),
  45. 'wff_min': lambda: round(random.uniform(0., 2.0), 3),
  46. 'wff_tau_max': lambda: random.randint(1000, 8000),
  47. 'wff_tau_min': lambda: random.randint(10, 500),
  48. 'wff_tau_tau': lambda: random.randint(50, 400),
  49. 'wff_beta': lambda: round(random.uniform(0.1, 1.0), 3),
  50. 'wr_const': lambda: round(random.uniform(0.1, 10.0), 3),
  51. 'dim': lambda: random.choice((1, 2)),
  52. 'A': lambda: round(random.uniform(0.1, 4.0), 3),
  53. 'B': lambda: round(random.uniform(0.1, 3.0), 3),
  54. 'sigma_exc': lambda: round(random.uniform(0., 8.0), 3),
  55. 'sigma_inh': lambda: round(random.uniform(0., 8.0), 3),
  56. 'tau_ff': lambda: random.randint(1, 100),
  57. 'tau_rec': lambda: random.randint(1, 100),
  58. 'syn_ff_tau': lambda: random.randint(1, 100),
  59. 'syn_ff_thr': lambda: round(random.uniform(0., 1.0), 3),
  60. 'rate_func_beta': lambda: round(random.uniform(0.1, 1.0), 3),
  61. 'rate_func_alpha': lambda: random.randint(50, 80),
  62. }
  63. logger.info(f"Param len={len(PARAMETERS)}, FXPARAM len={len(FIXED_PARAMETERS)}")
  64. # %% [markdown]
  65. # #### Init
  66. # %%
  67. # Create an animal
  68. animal = it.AnimalTrajectory(dt=1,
  69. prob_turn=0.01,
  70. prob_speed=0.1,
  71. prob_rest=0.01,
  72. day_cycle=True)
  73. # input layer
  74. layer = ms.InputLayer(N=FIXED_PARAMETERS['Nj'],
  75. kind='place',
  76. bounds=(0.05, 0.95, 0.05, 0.95),
  77. sigma=0.04, max_rate=300, min_rate=5)
  78. dataset = it.make_dataset(n_samples=1,
  79. animal=animal,
  80. layer=layer,
  81. duration=50,
  82. timestep=100, dx=0.1)
  83. track = se.Track2D(dataset=dataset,
  84. Nj=FIXED_PARAMETERS['Nj'],
  85. wmax=FIXED_PARAMETERS['wff_max'])
  86. logger.info("init")
  87. # %% [markdown]
  88. # ## Settings
  89. # %%
  90. # ---| Evolution |---
  91. # Create the toolbox
  92. toolbox = me.make_toolbox(PARAMETERS=PARAMETERS.copy(),
  93. game=track,
  94. agent_class=se.Agent,
  95. FIXED_PARAMETERS=FIXED_PARAMETERS.copy(),
  96. fitness_weights=(1., 1.))
  97. # ---| Run |---
  98. settings = {
  99. "NPOP": 25,
  100. "NGEN": 50,
  101. "CXPB": 0.5,
  102. "MUTPB": 0.2,
  103. "NLOG": 1,
  104. "TARGET": (40.5, 0),
  105. "TARGET_ERROR": 0.01,
  106. }
  107. # %% [markdown]
  108. # ## Run
  109. # %%
  110. agent = me.main(toolbox=toolbox,
  111. settings=settings)
  112. # genome
  113. print("\nGenome:")
  114. for k, v in agent.items():
  115. print(f"{k}: {v}")
  116. # %% [markdown]
  117. # ## Analysis
  118. # %%
  119. agent = me.load_best_individual()
  120. agent
  121. # %%
  122. ag = agent.copy()
  123. #ag['rate_func_alpha'] = 50
  124. #ag['rate_func_beta'] = 0.5
  125. #ag['eps'] = 10
  126. #ag['is_eps_scaled'] = True
  127. ag['N'] = 9
  128. ag['Nj'] = 9
  129. print(ag)
  130. net = mm.RateNetworkSimple(**ag)
  131. logger.info(net)
  132. # %%
  133. net = mm.RateNetworkSimple(**agent)
  134. logger.info(net)
  135. # %%
  136. # input layer
  137. layer = ms.InputLayer(N=ag['Nj'],
  138. kind='place',
  139. bounds=(0.05, 0.95, 0.05, 0.95),
  140. sigma=0.04, max_rate=10, min_rate=0)
  141. # model
  142. net.reset()
  143. net.set_plastic(plastic=True)
  144. # tuning
  145. rate_pc = it.get_network_tuning(model=net,
  146. layer=layer,
  147. mode='rate',
  148. dx=0.002,
  149. timestep=1,
  150. reset=False)
  151. nrows = net.n
  152. ncols = net.n
  153. fig, rows = plt.subplots(nrows, ncols, figsize=(5, 5))
  154. fig.suptitle(f"Place Cells tuning [{net.id}]")
  155. i = 0
  156. for cols in rows:
  157. for ax in cols:
  158. ax.imshow(rate_pc[:, i].reshape(int(np.sqrt(len(rate_pc))),
  159. int(np.sqrt(len(rate_pc)))),
  160. cmap='plasma')
  161. i += 1
  162. ax.set_xticks(())
  163. ax.set_yticks(())
  164. plt.show()
  165. # %%
  166. plt.figure(figsize=(3, 3))
  167. plt.imshow(net.Wff, cmap="plasma")
  168. plt.title("$W^{ff}$ weights")
  169. plt.xlabel('j')
  170. plt.ylabel('i')
  171. plt.show()
  172. print(np.around(net.Wff, 3))
  173. # %%
  174. np.around(rate_pc).shape
  175. # %%
  176. np.sort(net.Wff, axis=0)[-2:].T
  177. # %%
  178. np.diff((np.sort(net.Wff, axis=0)[-2:]), axis=0).sum()
  179. # %%
  180. ((np.sort(net.Wff, axis=0)[-2:].sum(axis=0))**2).sum()
  181. # %%
  182. wf = lambda x: 1 / (1 + np.exp(- 50 * (x - 0.85 * 5.)))
  183. w = np.ones((5, 5))*0.1 + 4.4*np.random.binomial(1, 0.1, (5, 5))
  184. w
  185. # %%
  186. np.around(wf(w.max(axis=0)).sum() / 5, 5)
  187. # %% [markdown]
  188. # ## Connectivity
  189. # ---
  190. # %%
  191. def mixture_of_gaussians_connectivity(size, amplitudes, sigmas):
  192. """ Create a connectivity pattern as a mixture of Gaussians """
  193. x, y = np.meshgrid(np.linspace(-1, 1, size), np.linspace(-1, 1, size))
  194. d = np.sqrt(x*x + y*y)
  195. pattern = np.zeros_like(d)
  196. for A, sigma in zip(amplitudes, sigmas):
  197. pattern += A * np.exp(-d**2 / (sigma**2))
  198. return pattern
  199. # Example parameters for the mixture of Gaussians
  200. amplitudes = [2.0, -2, 4] # Amplitudes for each Gaussian
  201. sigmas = [0.5, 1., 4] # Widths for each Gaussian
  202. size = 50
  203. mixture_pattern = mixture_of_gaussians_connectivity(size, amplitudes, sigmas)
  204. plt.figure(figsize=(6, 6))
  205. plt.imshow(mixture_pattern, cmap='RdBu')
  206. plt.colorbar()
  207. plt.title('Mixture of Gaussians Connectivity Pattern')
  208. plt.show()

lab_evolution-checkpoint.ipynb at commit ef9dd9f, no license · at the source

Overview

Authors: Krubeal Danieli1, Mikkel Elle Lepperød2
  1. Center for Integrative Neuroplasticity, FYSCELL, University of Oslo, Oslo, Norway
  2. Simula Research Laboratory, Oslo, Norway
Institutions: University of Oslo (Norway); Simula Research Laboratory (Norway)
Journal: PLoS computational biology, volume 22, issue 7, article e1013487
Dates: received 3 September 2025; accepted 15 June 2026; published online 28 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pcbi.1013487 · PMID 42520064 · PMCID PMC13450844 · OpenAlex W4414023443
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: none (in silico) (organism)
MeSH: Cognition*, Models, Neurological*, Spatial Navigation*, Animals, CA1 Region, Hippocampal, Computational Biology, Computer Simulation, Neuronal Plasticity, Place Cells, Reinforcement Machine Learning, Reward (* major topic)
Topic: Memory and Neural Mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: European Commission (HORIZON2020, 945371); Universitetet i Oslo (945371); Norges Forskningsråd (#270053)
Citations: not cited yet (Europe PMC); 110 references in the paper

Abstract

Animals develop specialized cognitive maps during navigation, constructing environmental representations that facilitate efficient exploration and goal-directed planning. The hippocampal CA1 region is implicated as the primary neural substrate for cognitive mapping, housing spatially tuned cells that adapt based on behavioral patterns and internal states. Computational approaches to modeling these biological systems have employed various methodologies. Although labeled graphs with local spatial information and deep neural networks have provided computational frameworks for spatial navigation, significant limitations persist in modeling one-shot adaptive mapping. We introduce a biologically inspired place cell architecture that develops cognitive maps during exploration of novel environments. Our model implements a simulated agent for reward-driven navigation that forms spatial representations online. The architecture incorporates behaviorally relevant information through neuromodulatory signals that respond to environmental boundaries and reward locations. Learning combines rapid Hebbian plasticity, lateral competition, and targeted modulation of place cells. Analysis of the model across a variety of environments demonstrates that online map formation and reward-directed navigation can emerge within a single simulated trial, without the multi-epoch training typically required by reinforcement-learning approaches. The simulation results show that the agent successfully explores and navigates to target locations in various environments, adapting when reward positions change. Analysis of neuromodulated place cells reveals dynamic changes in neuronal density and place field size after behaviorally significant events. These findings align with experimental observations of reward effects on hippocampal spatial cells while providing computational support for the efficacy of biologically inspired approaches to cognitive mapping.

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

Repository

Its files are read in the Code ↔ Paper reader above.

iKiru-hub/PCNN

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: ef9dd9f8a676a84aaefea558b1ac871ae6e9d654, 18 May 2026
Languages: Python (38), C++ (11), Jupyter (7), Shell (5), C (2), TypeScript (1)
Size: 742 files, 64 scripts
Software Heritage: not archived
Found in: “Data Availability”
Holds: README, environment (requirements.txt), tests, 4 notebooks
Not found: license file, CITATION.cff, continuous integration, documentation
Tools: Matplotlib (6 files), NumPy (6 files), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
7 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;
  • 6 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 and the simulation data are publicly available, and can be found at https://github.com/iKiru-hub/PCNN.

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 2, 28 September 2026

  • Funding: added European Commission: HORIZON2020, 945371; Universitetet i Oslo: 945371; Norges Forskningsråd: #270053

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 11 MeSH terms, 101 references.

Cite

This paper

Danieli, K., & Lepperød, M. E. (2026). Flexible navigation with neuromodulated cognitive maps. PLoS computational biology, 22(7), e1013487. https://doi.org/10.1371/journal.pcbi.1013487

BibTeX

@article{danieli2026flexible,
author = {Danieli, Krubeal and Lepperød, Mikkel Elle},
title = {{Flexible navigation with neuromodulated cognitive maps}},
journal = {PLoS computational biology},
year = {2026},
month = jul,
volume = {22},
number = {7},
pages = {e1013487},
publisher = {PLOS},
issn = {1553-734X},
doi = {10.1371/journal.pcbi.1013487},
url = {https://doi.org/10.1371/journal.pcbi.1013487},
pmid = {42520064},
pmcid = {PMC13450844}
}

RIS

TY - JOUR
AU - Danieli, Krubeal
AU - Lepperød, Mikkel Elle
TI - Flexible navigation with neuromodulated cognitive maps
T2 - PLoS computational biology
J2 - PLoS Comput Biol
PY - 2026
DA - 2026/07/28
VL - 22
IS - 7
SP - e1013487
SN - 1553-734X
PB - PLOS
DO - 10.1371/journal.pcbi.1013487
UR - https://doi.org/10.1371/journal.pcbi.1013487
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pcbi.1013487",
"type": "article-journal",
"title": "Flexible navigation with neuromodulated cognitive maps",
"container-title": "PLoS computational biology",
"author": [
{
"family": "Danieli",
"given": "Krubeal"
},
{
"family": "Lepperød",
"given": "Mikkel Elle"
}
],
"container-title-short": "PLoS Comput Biol",
"volume": "22",
"issue": "7",
"page": "e1013487",
"DOI": "10.1371/journal.pcbi.1013487",
"PMID": "42520064",
"PMCID": "PMC13450844",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pcbi.1013487",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
28
]
]
}
}

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.pbio.3003755 [code]
Action information is integrated into entorhinal representations of conceptual space and is reflected in eye movements.
Journal: PLoS biology
In common: SciPy, Matplotlib, NumPy, 7 references
[2] doi:10.1038/s42256-026-01254-4 [code]
Neural sampling from cognitive maps enables goal-directed imagination and planning.
Journal: Nature machine intelligence
In common: Matplotlib, NumPy, none (in silico), 6 references
[3] doi:10.1126/sciadv.adz9893 [code]
Hippocampal place cells map terrain geometry independently of behavior.
Journal: Science advances
In common: 7 references
[4] doi:10.7554/elife.106506 [code]
Modeling flexible behavior with remapping-based hippocampal sequence learning.
Journal: eLife
In common: SciPy, Matplotlib, NumPy, 5 references
[5] doi:10.1038/s41467-026-74357-6 [code]
Hippocampo-neocortical interaction as compressive retrieval-augmented generation.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, 4 references
[6] doi:10.7554/elife.108352 [code]
Analysis of dendritic input currents during place field dynamics.
Journal: eLife
In common: Matplotlib, NumPy, 4 references
[7] doi:10.1038/s41467-026-72275-1 [code]
Distinct CA3 inputs differentially shape the learning-dependent evolution of right CA1 spatial maps.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, 3 references
[8] doi:10.1038/s41467-026-73994-1 [code]
Prediction error correlates in the striosome-dopamine circuit emerge from information gain.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, 3 references
[9] doi:10.1126/sciadv.aea1037 [code]
Distinct cortical spatial representations learned along disparate visual pathways.
Journal: Science advances
In common: SciPy, Matplotlib, NumPy, 3 references
[10] doi:10.1038/s41593-026-02365-2 [code]
Hippocampal theta sweeps indicate goal direction during navigation.
Journal: Nature neuroscience
In common: SciPy, Matplotlib, NumPy, 3 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.

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.