Spiking neural models for decision-making tasks with learning.
The 4 matches
- [1] § The experiment › Single participant analysis ↔ functions_simulator.py, lines 226–358 · score 0.59 · weight updates, learning phase, zero, mistake, answer, neurons
- [2] § The experiment › Participants ↔ plot_answer_times.ipynb, lines 248–317 · score 0.58 · Middle school students, undergraduate students
- [3] § The experiment › Analysis ↔ functions_simulator.py, lines 96–224 · score 0.57 · transfer phase, learning phase, speed, threshold, answer, weights
- [4] § The experiment › Procedure ↔ plot_answer_times.ipynb, lines 248–317 · score 0.57 · Middle school students, undergraduate students
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
Python · 359 lines · 12 KB · GPL-3.0 · 2 matches
- import numpy as np
- import scipy.stats as stats
- import matplotlib.pyplot as plt
- import scipy.special as spe
- import torch
- def inA(object):
- return object[0]==0
- def inB(object):
- return not inA(object)
- def ObjLearningTransfer(n):
- """
- Returns the list of the n objects used for the learning phase and the ntot - n objects used for the transfer phase (here n = 10 and 6 objects for the transfer phase)
- """
- obj = np.array([
- [1,0,1,0,1,0,1,0],
- [1,0,1,0,1,0,0,1],
- [1,0,1,0,0,1,1,0],
- [1,0,1,0,0,1,0,1],
- [1,0,0,1,1,0,1,0],
- [1,0,0,1,1,0,0,1],
- [1,0,0,1,0,1,1,0],
- [1,0,0,1,0,1,0,1],
- [0,1,1,0,1,0,1,0],
- [0,1,1,0,1,0,0,1],
- [0,1,1,0,0,1,1,0],
- [0,1,1,0,0,1,0,1],
- [0,1,0,1,1,0,1,0],
- [0,1,0,1,1,0,0,1],
- [0,1,0,1,0,1,1,0],
- [0,1,0,1,0,1,0,1],
- ])
- #8 first in B, 8 last in A
- A = obj[8:, :]
- B = obj[:8, :]
- A2 = np.copy(A)
- np.random.shuffle(A2)
- B2 = np.copy(B)
- np.random.shuffle(B2)
- n2 = int(n/2)
- learning = np.concatenate((A2[:n2,:],B2[:n2,:])) # 8,10
- transfer = np.concatenate((A2[n2:,:], B2[n2:,:])) # 8, 4
- np.random.shuffle(learning)
- np.random.shuffle(transfer)
- return transfer, learning
- def GainOutput(P_mid, obj): #target = label of current image
- gain = np.zeros((2, 8))
- if inA(obj):
- gain[0,:] = 2 * P_mid
- gain[1,:] = - gain[0,:]
- else:
- gain[1,:] = 2 * P_mid
- gain[0,:] = - gain[1,:]
- return gain
- def EWA(W_not_renorm, eta, cred):
- """
- Updates the weights `W_not_renorm` using the Exponentially Weighted Average (EWA) method.
- """
- res = W_not_renorm.copy()
- res[:, :] *= np.exp(eta * cred[:, :])
- return res
- def Poisson(lamb, T):
- nb_points = stats.poisson.rvs(lamb*T)
- points = stats.uniform.rvs(0,T, size = nb_points)
- return points
- def discrete_Hawkes(input_neurons, W, g):
- """
- input_neurons: np matrix (nI, N) with N = T/dt
- W: matrix (nJ, nI)
- g: np array (A)
- """
- nJ, nI = W.shape
- A = g.shape[0]
- N = input_neurons.shape[1]
- # Initialize the probability output matrix
- prob_output = np.zeros((nJ, N))
- # Accumulate the weighted sums over the lag values in g
- for s in range(A):
- if s < N:
- prob_output[:, s:] += g[s] * np.dot(W, input_neurons[:, :N-s])
- def simulator_vectorized(eta_output, s, f = 300, N = 5000, nb_obj_max = 100): #s = threshold (proportion to reach, between 0 and 1), f = firing rate (freq of spikes, nb by second)
- K_input = 8
- K_output = 2
- s = N*s
- p = 5 * f / N #0.3
- transfer, learning = ObjLearningTransfer(10) #gives the 10 learning objects and 6 transfer objects
- cond = True #when a bloc is correctly classified it becomes false
- answers = []
- accuracy = []
- times = np.zeros(nb_obj_max)
- W_output = np.zeros((K_output, K_input)) + 1/K_input
- cum_gain = np.zeros((K_output, K_input))
- nb_obj = 0
- bloc = np.copy(learning)
- #Learning phase
- while cond:
- m = 0
- condbis = True #becomes false when there is a mistake
- np.random.shuffle(bloc)
- if np.sum(accuracy[-10:])==10:
- num = 5
- else:
- num = 10
- while condbis and m < num:
- #Simulation input neurons
- prob_input = np.transpose(np.array([p*bloc[m,:] for i in range(N)])) #proba until max time
- input_neurons_out = stats.bernoulli.rvs(prob_input) #simu until max time (K_input, N)
- #Simulation output neurons
- prob_output = np.sum(W_output[:,None,:] * input_neurons_out.T, axis = 2)
- output_neurons = stats.bernoulli.rvs(prob_output)
- #Approximated BM
- S = np.cumsum(output_neurons, axis = 1)
- #reac time and classif
- SA = S[0,:]
- SB = S[1,:]
- timesA = np.where(SA >= s)[0]
- timesB = np.where(SB >= s)[0]
- if np.shape(timesA)[0]==0 and np.shape(timesB)[0] == 0:
- times[nb_obj] = N
- answers.append(-1)
- elif np.shape(timesA)[0]==0: #B reaches threshold first
- times[nb_obj] = timesB[0]
- answers.append(1)
- elif np.shape(timesB)[0]==0:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- if timesA[0] < timesB[0]:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- times[nb_obj] = timesB[0]
- answers.append(1)
- if answers[-1] == bloc[m,0] :
- accuracy.append(1)
- else:
- accuracy.append(0)
- N_time_steps = int(times[nb_obj])
- P_input = np.sum(input_neurons_out[:,:N_time_steps], axis = 1) / N_time_steps
- #Weights update
- gain_output = GainOutput(P_input, bloc[m,:])
- cum_gain += gain_output
- W_output = spe.softmax(eta_output * cum_gain, axis = 1)
- #W_output_tot[:,:,nb_obj] = W_output
- nb_obj += 1
- m+=1
- if nb_obj == nb_obj_max - 18 :
- return nb_obj_max + 1, times, accuracy
- condbis = condbis and (accuracy[-1] == 1)
- #condition update
- if np.sum(accuracy[-15:])==15 or nb_obj == nb_obj_max - 18:
- cond = False
- #Transfer phase
- transfer_objects = np.zeros((18,8))
- bloc_transfer = np.copy(transfer)
- np.random.shuffle(bloc_transfer)
- transfer_objects[:6,:] = bloc_transfer
- transfer_objects[6:12,:] = bloc_transfer
- transfer_objects[12:,:] = bloc_transfer
- prob_input = np.transpose(np.array([p*transfer_objects for i in range(N)]))
- input_neurons_out = stats.bernoulli.rvs(prob_input) #(K_input, 18, N)
- prob_output = np.einsum('imt, ki -> kmt', input_neurons_out, W_output)
- output_neurons = stats.bernoulli.rvs(prob_output) #(K_output, 18, N)
- S = np.cumsum(output_neurons, axis = 2) #(K_output, 18, N)
- #reac time and classif
- for m in range(18):
- SA = S[0,m,:]
- SB = S[1,m,:]
- timesA = np.where(SA >= s)[0]
- timesB = np.where(SB >= s)[0]
- if np.shape(timesA)[0]==0 and np.shape(timesB)[0] == 0:
- times[nb_obj] = N
- answers.append(-1)
- elif np.shape(timesA)[0]==0: #B reaches threshold first
- times[nb_obj] = timesB[0]
- answers.append(1)
- elif np.shape(timesB)[0]==0:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- if timesA[0] < timesB[0]:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- times[nb_obj] = timesB[0]
- answers.append(1)
- nb_obj +=1
- n = nb_obj
- fill_time = np.sum(times[n-18:n])/18 #average time transfer phase
- times[n:]+=fill_time
- #conversion in seconds (max time = 5s)
- times = 5 * times / N
- return n, times, accuracy
- def simulator_vectorized_fix_nb_obj(eta_output, s, nb_obj_learning, f = 300, N = 5000): #s = threshold (proportion to reach, between 0 and 1), f = firing rate (freq of spikes)
- """
- nb_obj_learning: objects before the transfer phase
- """
- K_input = 8
- K_output = 2
- s = N*s
- p = 5 * f / N #0.3
- #W_output_tot = np.zeros((K_output, K_input, nb_obj_max))
- transfer, learning = ObjLearningTransfer(10) #gives the 10 learning objects and 6 transfer objects
- cond = True #when a bloc is correctly classified it becomes false
- answers = []
- accuracy = []
- times = np.zeros(nb_obj_learning + 18)
- W_output = np.zeros((K_output, K_input)) + 1/K_input
- cum_gain = np.zeros((K_output, K_input))
- nb_obj = 0
- bloc = np.copy(learning)
- #Learning phase
- while cond:
- m = 0
- condbis = True #becomes false when there is a mistake
- np.random.shuffle(bloc)
- if np.sum(accuracy[-10:])==10:
- num = 5
- else:
- num = 10
- while condbis and m < num:
- #Simulation input neurons
- prob_input = np.transpose(np.array([p*bloc[m,:] for i in range(N)])) #proba until max time
- input_neurons_out = stats.bernoulli.rvs(prob_input) #simu until max time (K_input, N)
- #Simulation output neurons
- prob_output = np.sum(W_output[:,None,:] * input_neurons_out.T, axis = 2)
- output_neurons = stats.bernoulli.rvs(prob_output)
- #Approximated BM
- S = np.cumsum(output_neurons, axis = 1)
- #reac time and classif
- SA = S[0,:]
- SB = S[1,:]
- timesA = np.where(SA >= s)[0]
- timesB = np.where(SB >= s)[0]
- if np.shape(timesA)[0]==0 and np.shape(timesB)[0] == 0:
- times[nb_obj] = N
- answers.append(-1)
- elif np.shape(timesA)[0]==0: #B reaches threshold first
- times[nb_obj] = timesB[0]
- answers.append(1)
- elif np.shape(timesB)[0]==0:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- if timesA[0] < timesB[0]:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- times[nb_obj] = timesB[0]
- answers.append(1)
- if answers[-1] == bloc[m,0] :
- accuracy.append(1)
- else:
- accuracy.append(0)
- N_time_steps = int(times[nb_obj])
- P_input = np.sum(input_neurons_out[:,:N_time_steps], axis = 1) / N_time_steps
- #Weights update
- gain_output = GainOutput(P_input, bloc[m,:])
- cum_gain += gain_output
- W_output = spe.softmax(eta_output * cum_gain, axis = 1)
- #W_output_tot[:,:,nb_obj] = W_output
- nb_obj += 1
- m+=1
- condbis = condbis and (accuracy[-1] == 1)
- #print(nb_obj)
- if nb_obj == nb_obj_learning:
- condbis = False
- #condition update
- if nb_obj == nb_obj_learning :
- cond = False
- #Transfer phase
- transfer_objects = np.zeros((18,8))
- bloc_transfer = np.copy(transfer)
- np.random.shuffle(bloc_transfer)
- transfer_objects[:6,:] = bloc_transfer
- transfer_objects[6:12,:] = bloc_transfer
- transfer_objects[12:,:] = bloc_transfer
- prob_input = np.transpose(np.array([p*transfer_objects for i in range(N)]))
- input_neurons_out = stats.bernoulli.rvs(prob_input) #(K_input, 18, N)
- prob_output = np.einsum('imt, ki -> kmt', input_neurons_out, W_output)
- output_neurons = stats.bernoulli.rvs(prob_output) #(K_output, 18, N)
- S = np.cumsum(output_neurons, axis = 2) #(K_output, 18, N)
- #reac time and classif
- for m in range(18):
- SA = S[0,m,:]
- SB = S[1,m,:]
- timesA = np.where(SA >= s)[0]
- timesB = np.where(SB >= s)[0]
- if np.shape(timesA)[0]==0 and np.shape(timesB)[0] == 0:
- times[nb_obj] = N
- answers.append(-1)
- elif np.shape(timesA)[0]==0: #B reaches threshold first
- times[nb_obj] = timesB[0]
- answers.append(1)
- elif np.shape(timesB)[0]==0:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- if timesA[0] < timesB[0]:
- times[nb_obj] = timesA[0]
- answers.append(0)
- else:
- times[nb_obj] = timesB[0]
- answers.append(1)
- nb_obj +=1
- n = nb_obj
- fill_time = np.sum(times[n-18:n])/18 #average time transfer phase
- times[n:]+=fill_time
- #conversion in seconds (max time = 5s)
- times = 5 * times / N
- return times, accuracy
functions_simulator.py at commit dfe76b2, under GPL-3.0 · at the source
Overview
- Center for Systems Biology Dresden, Max Planck Institute of Molecular Cell Biology and Genetics, Dresden, Germany
- Centre Borelli, École Normale Supérieure Paris-Saclay, Paris, France
- Laboratoire J. A. Dieudonné, CNRS, Université Côte d’Azur, Nice, France
- Université Côte D’Azur, Inria, CNRS, LJAD, Nice, France
Abstract
In cognition, response times and choices in decision-making tasks are commonly modeled using Drift Diffusion Models (DDMs), which describe the accumulation of evidence for a decision as a stochastic process, specifically a Brownian motion, with the drift rate reflecting the strength of the evidence. In the same vein, the Poisson counter model describes the accumulation of evidence as discrete events whose counts over time are modeled as Poisson processes. This model has a spiking neurons interpretation as these processes are used to model neuronal activities. However, these models lack a learning mechanism and are limited to tasks where participants have prior knowledge of the categories. To bridge the gap between cognitive and biological models, we propose a biologically plausible Spiking Neural Network (SNN) model for decision-making that incorporates a learning mechanism and whose neurons activities are modeled by a multivariate Hawkes process. First, we show a coupling result between the DDM and the Poisson counter model, establishing that these two models provide similar categorizations and reaction times and that the DDM can be approximated by spiking Poisson neurons. To go further, we show that a particular DDM with correlated noise can be derived from a Hawkes network of spiking neurons governed by a local learning rule. In addition, we designed an online categorization task to evaluate the model predictions. This work provides a significant step toward integrating biologically relevant neural mechanisms into cognitive models, fostering a deeper understanding of the relationship between neural activity and behavior.
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 4 matches between paragraphs and lines of code.
SophieJaffard/MEL
dfe76b2e73f60a32bca7fcab5442909207f784da, 2 February 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
6 files
- functions_simulator.py, Python, 359 lines, 2 matches
- plot_answer_times.ipynb, Jupyter, 318 lines, 2 matches
- plot_posteriors.ipynb, Jupyter, 109 lines
- sbi_synthetic_data.ipynb
, Jupyter, 102 lines - sbi_true_data.ipynb, Jupyter, 130 lines
- LICENSE, License, 674 lines
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;
- 4 matches 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
No dataset and no data link were found in the paper.
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
- Publisher: n/a → Springer Science+Business Media
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 15 MeSH terms, 3 funders, 38 references.
Cite
This paper
Jaffard, S., Mezzadri, G., Reynaud-Bouret, P., & Tanré, E. (2026). Spiking neural models for decision-making tasks with learning. Journal of mathematical biology, 93(1), 1. https://
BibTeX
@article{jaffard2026spik
author = {Jaffard, Sophie and Mezzadri, Giulia and Reynaud-Bouret, Patricia and Tanré, Etienne},
title = {{Spiking neural models for decision-making tasks with learning}},
journal = {Journal of mathematical biology},
year = {2026},
month = jun,
volume = {93},
number = {1},
pages = {1},
publisher = {Springer Science+Business Media},
issn = {0303-6812},
doi = {10.1007/
url = {https://
pmid = {42283906},
pmcid = {PMC13263290}
}
RIS
TY - JOUR
AU - Jaffard, Sophie
AU - Mezzadri, Giulia
AU - Reynaud-Bouret, Patricia
AU - Tanré, Etienne
TI - Spiking neural models for decision-making tasks with learning
T2 - Journal of mathematical biology
J2 - J Math Biol
PY - 2026
DA - 2026/
VL - 93
IS - 1
SP - 1
SN - 0303-6812
PB - Springer Science+Business Media
DO - 10.1007/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1007/
"type": "article-journal",
"title": "Spiking neural models for decision-making tasks with learning",
"container-title": "Journal of mathematical biology",
"author": [
{
"family": "Jaffard",
"given": "Sophie"
},
{
"family": "Mezzadri",
"given": "Giulia"
},
{
"family": "Reynaud-Bouret",
"given": "Patricia"
},
{
"family": "Tanré",
"given": "Etienne"
}
],
"container-title-short":
"volume": "93",
"issue": "1",
"page": "1",
"DOI": "10.1007/
"PMID": "42283906",
"PMCID": "PMC13263290",
"ISSN": "0303-6812",
"publisher": "Springer Science+Business Media",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
12
]
]
}
}
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.1126/sciadv.aed1338 [code]
- Natural noncoding &
lt;i& gt;pumilio& lt;/ i& gt; variants retune value-coding interneurons to bias & lt;i& gt;Drosophila& lt;/ i& gt; oviposition decisions. Journal: Science advancesIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 2 references - [2] doi:10.1038/s41467-026-72445-1 [code]
- Perception and neural representation of intermittent odor stimuli in mice.Journal: Nature communicationsIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 2 references
- [3] doi:10.1073/pnas.2616911123 [code]
- Cerebellar microcircuits enable robust evidence-based decisions through cortico-cerebellar coupling.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: Matplotlib, NumPy, cognitive, 2 references
- [4] doi:10.1038/s41467-026-73669-x [code]
- Homeostatic dendritic neuron based on co-integrated volatile and non-volatile memristors for neuromorphic processing.Journal: Nature communicationsIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference
- [5] doi:10.7554/elife.105953 [code]
- Top-down feedback in deep neural networks leads to functional differences during audiovisual integration.Journal: eLifeIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference
- [6] doi:10.1038/s41467-026-76098-y [code]
- A single computational objective can produce specialization of streams in visual cortex.Journal: Nature communicationsIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference
- [7] doi:10.1038/s41467-026-73938-9 [code]
- Higher visual areas act like domain-general filters with strong selectivity and functional specialization.Journal: Nature communicationsIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference
- [8] doi:10.1038/s42003-026-10094-2 [code]
- E/
I imbalance and internal noise cause weak neural representations and face recognition challenges in ASD. Journal: Communications biologyIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference - [9] doi:10.1167/jov.26.8.2 [code]
- Disentangling objects' contextual associations from perceptual and conceptual attributes using time-resolved neural decoding.Journal: Journal of visionIn common: SciPy, Matplotlib, NumPy, cognitive, 1 reference
- [10] doi:10.3389/fnsys.2026.1822122 [code]
- Convergence-divergence circuits for multimodal integration of innate and learned opponent valences.Journal: Frontiers in systems neuroscienceIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference
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 4 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:9635efef821e703c…
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.
