This project focuses on various coding schemes and learning methods in neural networks, including STDP (Spike-Timing Dependent Plasticity) for unsupervised learning and RSTDP (Reward-modulated STDP) for reinforcement learning. It implements models for encoding spike-based information and adjusting synaptic weights in response to input stimuli.
The aim of this project is to explore how different neural coding schemes and learning rules can be applied in neuronal networks. It covers spike-based coding strategies such as Time To First Spike (TTFS) and Poisson Distribution Encoding, as well as learning mechanisms like STDP and RSTDP for adjusting synaptic weights based on temporal relationships between spikes and rewards.
- Neural Coding Schemes:
- Time To First Spike (TTFS): A method of encoding information based on the time of the first spike.
- Poisson Distribution Encoding: Simulating neuron spiking based on Poisson-distributed input spikes.
-
Unsupervised Learning with STDP:
- Spike-Timing Dependent Plasticity (STDP): Adjusts synaptic weights based on the temporal order of pre- and post-synaptic spikes.
-
Reinforcement Learning with RSTDP:
- Reward-modulated STDP (RSTDP): Synaptic plasticity is modulated by external rewards, where rewards reinforce useful patterns of activity.
-
Synaptic Weight Dynamics:
- Tracks changes in synaptic weights under different input conditions (noisy fixed input, Poisson-distributed inputs).
-
Cosine Similarity:
- Measures the similarity between synaptic weight vectors over time, showing the clustering of neurons in response to inputs.
-
Inactive Neuron Impact:
- Analyzes how inactive neurons (neurons that do not spike) affect the overall synaptic weight dynamics.
-
Clone the repository:
git clone https://github.com/MohaZamani/Neural-Learning-and-Coding.git
-
Install the necessary dependencies:
pip install -r requirements.txt
-
Run the simulation notebooks:
- For Encoding: Open and run
Coding.ipynb
- For STDP Learning: Open and run
STDPLearning.ipynb
- For RSTDP Learning: Open and run
RSTDPLearning.ipynb
You can launch the notebooks using Jupyter by executing:
jupyter notebook
- For Encoding: Open and run
Results from the simulations include:
- Spike Raster Plots: Visualizing the spiking activity of neurons under different input coding strategies.
- Synaptic Weight Changes: Charts showing how synaptic weights evolve over time in response to different input conditions.
- Cosine Similarity: Plots measuring the similarity between synaptic weight vectors over time, demonstrating clustering and separation.
- Impact of Inactive Neurons: Analysis of how inactive neurons affect synaptic dynamics and learning processes.
All simulation results and further analysis is available in the report.
- Poisson Coding: Wikipedia Article on Poisson Distribution
- Hebbian learning: Hebb Rule and Experiments
- Spike-Timing Dependent Plasticity (STDP): Wikipedia Article on STDP
- Reward-modulated STDP (RSTDP): Article on R-STDP
- Neural Dynamics: Neural Dynamics Online Resources
- Cosine Similarity: Wikipedia Article on Cosine Similarity