Flexible navigation with neuromodulated cognitive maps.
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
- # %%
- import numpy as np
- import random
- import matplotlib.pyplot as plt
- import mod_models as mm
- import mod_evolution as me
- import sim_evo_I as se
- from mod_models import logger
- import inputools.Trajectory as it
- from tqdm import tqdm
- %load_ext autoreload
- %autoreload 2
- # %% [markdown]
- # ## Setup
- # %% [markdown]
- # #### Genome
- # %%
- # parameters that are not evolved
- FIXED_PARAMETERS = {
- 'N': 9,
- 'Nj': 9,
- 'dim': 2,
- 'lr_min': 1e-5,
- 'lr_tau': 100,
- 'wff_const': 5.5,
- 'wff_max': 4.5,
- 'wff_min': 0.01,
- 'wff_tau_max': 2000,
- 'wff_tau_min': 50,
- 'tau_ff': 10,
- 'tau_rec': 5,
- 'syn_ff_tau': 10,
- 'syn_ff_thr': 0.5,
- 'rate_func_beta': 0.3,
- 'rate_func_alpha': 60,
- }
- # Define the genome as a dict of parameters
- PARAMETERS = {
- 'tau_u': lambda: random.randint(1, 300),
- 'lr_max': lambda: round(random.uniform(5e-3, 0.1), 3),
- 'lr_min': lambda: round(random.uniform(1e-3, 1e-6), 3),
- 'lr_tau': lambda: random.randint(50, 300),
- 'wff_const': lambda: round(random.uniform(4.0, 10.0), 3),
- 'wff_max': lambda: round(random.uniform(2.0, 10.0), 3),
- 'wff_min': lambda: round(random.uniform(0., 2.0), 3),
- 'wff_tau_max': lambda: random.randint(1000, 8000),
- 'wff_tau_min': lambda: random.randint(10, 500),
- 'wff_tau_tau': lambda: random.randint(50, 400),
- 'wff_beta': lambda: round(random.uniform(0.1, 1.0), 3),
- 'wr_const': lambda: round(random.uniform(0.1, 10.0), 3),
- 'dim': lambda: random.choice((1, 2)),
- 'A': lambda: round(random.uniform(0.1, 4.0), 3),
- 'B': lambda: round(random.uniform(0.1, 3.0), 3),
- 'sigma_exc': lambda: round(random.uniform(0., 8.0), 3),
- 'sigma_inh': lambda: round(random.uniform(0., 8.0), 3),
- 'tau_ff': lambda: random.randint(1, 100),
- 'tau_rec': lambda: random.randint(1, 100),
- 'syn_ff_tau': lambda: random.randint(1, 100),
- 'syn_ff_thr': lambda: round(random.uniform(0., 1.0), 3),
- 'rate_func_beta': lambda: round(random.uniform(0.1, 1.0), 3),
- 'rate_func_alpha': lambda: random.randint(50, 80),
- }
- logger.info(f"Param len={len(PARAMETERS)}, FXPARAM len={len(FIXED_PARAMETERS)}")
- # %% [markdown]
- # #### Init
- # %%
- # Create an animal
- animal = it.AnimalTrajectory(dt=1,
- prob_turn=0.01,
- prob_speed=0.1,
- prob_rest=0.01,
- day_cycle=True)
- # input layer
- layer = ms.InputLayer(N=FIXED_PARAMETERS['Nj'],
- kind='place',
- bounds=(0.05, 0.95, 0.05, 0.95),
- sigma=0.04, max_rate=300, min_rate=5)
- dataset = it.make_dataset(n_samples=1,
- animal=animal,
- layer=layer,
- duration=50,
- timestep=100, dx=0.1)
- track = se.Track2D(dataset=dataset,
- Nj=FIXED_PARAMETERS['Nj'],
- wmax=FIXED_PARAMETERS['wff_max'])
- logger.info("init")
- # %% [markdown]
- # ## Settings
- # %%
- # ---| Evolution |---
- # Create the toolbox
- toolbox = me.make_toolbox(PARAMETERS=PARAMETERS.copy(),
- game=track,
- agent_class=se.Agent,
- FIXED_PARAMETERS=FIXED_PARAMETERS.copy(),
- fitness_weights=(1., 1.))
- # ---| Run |---
- settings = {
- "NPOP": 25,
- "NGEN": 50,
- "CXPB": 0.5,
- "MUTPB": 0.2,
- "NLOG": 1,
- "TARGET": (40.5, 0),
- "TARGET_ERROR": 0.01,
- }
- # %% [markdown]
- # ## Run
- # %%
- agent = me.main(toolbox=toolbox,
- settings=settings)
- # genome
- print("\nGenome:")
- for k, v in agent.items():
- print(f"{k}: {v}")
- # %% [markdown]
- # ## Analysis
- # %%
- agent = me.load_best_individual()
- agent
- # %%
- ag = agent.copy()
- #ag['rate_func_alpha'] = 50
- #ag['rate_func_beta'] = 0.5
- #ag['eps'] = 10
- #ag['is_eps_scaled'] = True
- ag['N'] = 9
- ag['Nj'] = 9
- print(ag)
- net = mm.RateNetworkSimple(**ag)
- logger.info(net)
- # %%
- net = mm.RateNetworkSimple(**agent)
- logger.info(net)
- # %%
- # input layer
- layer = ms.InputLayer(N=ag['Nj'],
- kind='place',
- bounds=(0.05, 0.95, 0.05, 0.95),
- sigma=0.04, max_rate=10, min_rate=0)
- # model
- net.reset()
- net.set_plastic(plastic=True)
- # tuning
- rate_pc = it.get_network_tuning(model=net,
- layer=layer,
- mode='rate',
- dx=0.002,
- timestep=1,
- reset=False)
- nrows = net.n
- ncols = net.n
- fig, rows = plt.subplots(nrows, ncols, figsize=(5, 5))
- fig.suptitle(f"Place Cells tuning [{net.id}]")
- i = 0
- for cols in rows:
- for ax in cols:
- ax.imshow(rate_pc[:, i].reshape(int(np.sqrt(len(rate_pc))),
- int(np.sqrt(len(rate_pc)))),
- cmap='plasma')
- i += 1
- ax.set_xticks(())
- ax.set_yticks(())
- plt.show()
- # %%
- plt.figure(figsize=(3, 3))
- plt.imshow(net.Wff, cmap="plasma")
- plt.title("$W^{ff}$ weights")
- plt.xlabel('j')
- plt.ylabel('i')
- plt.show()
- print(np.around(net.Wff, 3))
- # %%
- np.around(rate_pc).shape
- # %%
- np.sort(net.Wff, axis=0)[-2:].T
- # %%
- np.diff((np.sort(net.Wff, axis=0)[-2:]), axis=0).sum()
- # %%
- ((np.sort(net.Wff, axis=0)[-2:].sum(axis=0))**2).sum()
- # %%
- wf = lambda x: 1 / (1 + np.exp(- 50 * (x - 0.85 * 5.)))
- w = np.ones((5, 5))*0.1 + 4.4*np.random.binomial(1, 0.1, (5, 5))
- w
- # %%
- np.around(wf(w.max(axis=0)).sum() / 5, 5)
- # %% [markdown]
- # ## Connectivity
- # ---
- # %%
- def mixture_of_gaussians_connectivity(size, amplitudes, sigmas):
- """ Create a connectivity pattern as a mixture of Gaussians """
- x, y = np.meshgrid(np.linspace(-1, 1, size), np.linspace(-1, 1, size))
- d = np.sqrt(x*x + y*y)
- pattern = np.zeros_like(d)
- for A, sigma in zip(amplitudes, sigmas):
- pattern += A * np.exp(-d**2 / (sigma**2))
- return pattern
- # Example parameters for the mixture of Gaussians
- amplitudes = [2.0, -2, 4] # Amplitudes for each Gaussian
- sigmas = [0.5, 1., 4] # Widths for each Gaussian
- size = 50
- mixture_pattern = mixture_of_gaussians_connectivity(size, amplitudes, sigmas)
- plt.figure(figsize=(6, 6))
- plt.imshow(mixture_pattern, cmap='RdBu')
- plt.colorbar()
- plt.title('Mixture of Gaussians Connectivity Pattern')
- plt.show()
lab_evolution-checkpoint.ipynb at commit ef9dd9f, no license · at the source
Overview
- Center for Integrative Neuroplasticity, FYSCELL, University of Oslo, Oslo, Norway
- Simula Research Laboratory, Oslo, Norway
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
ef9dd9f8a676a84aaefea558b1ac871ae6e9d654, 18 May 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
7 files
- .ipynb_checkpoints/
lab_evolution-checkpoint , Jupyter, 262 lines.ipynb - .ipynb_checkpoints/
lab_pcnn_model-checkpoin , Jupyter, 3,689 linest.ipynb - .ipynb_checkpoints/
lab_pcnn_nonhot_1-checkp , Jupyter, 2,308 linesoint.ipynb - notebooks/
lab_analysis_1.ipynb , Jupyter, 1,241 lines - notebooks/
lab_analysis_2.ipynb , Jupyter, 731 lines - notebooks/
lab_pcore_1.ipynb , Jupyter, 4,693 lines - repository limit reached (2,000 files or 30 MB): the rest is at the source (58 files)
- README.md, Text, 26 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;
- 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://
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://
BibTeX
@article{danieli2026flex
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/
url = {https://
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/
VL - 22
IS - 7
SP - e1013487
SN - 1553-734X
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"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":
"volume": "22",
"issue": "7",
"page": "e1013487",
"DOI": "10.1371/
"PMID": "42520064",
"PMCID": "PMC13450844",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://
"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 biologyIn 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 intelligenceIn 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 advancesIn common: 7 references
- [4] doi:10.7554/elife.106506 [code]
- Modeling flexible behavior with remapping-based hippocampal sequence learning.Journal: eLifeIn 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 communicationsIn common: SciPy, Matplotlib, NumPy, 4 references
- [6] doi:10.7554/elife.108352 [code]
- Analysis of dendritic input currents during place field dynamics.Journal: eLifeIn 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 communicationsIn 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 communicationsIn common: SciPy, Matplotlib, NumPy, 3 references
- [9] doi:10.1126/sciadv.aea1037 [code]
- Distinct cortical spatial representations learned along disparate visual pathways.Journal: Science advancesIn 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 neuroscienceIn 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.
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, 6 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:1be3f8fbfcac9470…
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.
