Cracking the Brain's Secret Code for Success: How Timing and Dopamine Decide What Works
This repository contains simple Python demos illustrating how STDP (spike-timing dependent plasticity) and dopamine signaling allow networks to learn from delayed rewards, based on the paper: Solving the Distal Reward Problem through Linkage of STDP and Dopamine Signaling. Link: https://academic.oup.com/cercor/article/17/10/2443/314939
The demos explore how the brain identifies which connections to strengthen when rewards arrive after a delay.
Demos
-
Casino Synapse Demo Idea: One synapse occasionally “gets lucky” and is reinforced when dopamine arrives. What it shows: STDP tags synapses based on timing. Dopamine selectively strengthens the tagged synapse. Synaptic weight grows over time like a staircase.
-
Classical Conditioning Demo Idea: One stimulus out of many is paired with a reward. What it shows: The network learns to prioritize the rewarded stimulus. Other stimuli remain weak (“signal out of noise”).
-
Dopamine Shift Demo Idea: Dopamine initially responds to the reward, then shifts to a predictive cue. What it shows: Learning to anticipate reward. Dopamine firing moves from reward to cue over trials.
-
Instrumental Conditioning Demo (already implemented) Idea: Network learns which action to take to get a reward. What it shows: Probability of correct action increases over trials. Network adapts if the rewarded action changes.
How to Run
Clone the repo:
git clone https://github.com/Ria-Chaudhry/Hebbian_RNN_Model-.git cd name it
Install dependencies: pip install numpy matplotlib
Run any demo: python <demo_filename>.py
Background These demos illustrate the core idea from the paper: STDP tags synapses based on spike timing. Dopamine signals reward and reinforces the tagged synapses. This combination allows networks to solve the distal reward problem: learning which neural connections caused a delayed reward.