Skip to content

omgbox/SORN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SORN: Self-Organizing Recurrent Neural Network

A pure-Julia implementation of a biologically plausible spiking neural network combining five plasticity mechanisms with excitatory-inhibitory balance.

Unique Contribution

First pure-Julia SORN combining:

  1. Pair STDP — Hebbian learning on E→E connections
  2. Inhibitory STDP — Anti-Hebbian learning on I→E connections
  3. Synaptic Scaling — Homeostatic weight normalization
  4. Intrinsic Plasticity — Adaptive spike thresholds (LIF)
  5. Structural Plasticity — Dynamic synapse formation/elimination

with biologically realistic 80:20 E/I balance.

Architecture

  • Excitatory neurons: Leaky Integrate-and-Fire with adaptive threshold
  • Inhibitory neurons: Izhikevich fast-spiking model
  • Connectivity: Sparse random with 80:20 E/I ratio
  • Weight matrices: E→E (plastic), I→E (plastic), E→I (fixed), Input→E (fixed)

Performance

  • Sparse weight matrices (SparseMatrixCSC) — only stores 15% non-zero connections
  • Struct-of-arrays layout for SIMD vectorization
  • Zero-allocation simulation loop
  • All inner loops @simd-vectorized (neuron updates, current computation, weight scaling, recording)
  • Analytical LIF solution (exact ODE integration, not Euler approximation)
  • Exponential decay for threshold adaptation and synaptic scaling
  • Structural plasticity rebuilds from IJV triplets (avoids O(nnz) per-insertion cost)

Scaling (Celeron N4020)

Neurons 500ms sim 1000ms sim
100 ~50ms ~100ms
200 ~60ms ~130ms
400 ~480ms ~960ms
800 ~2s ~4s
1600 ~10s ~20s

Quick Start

julia --project=. examples/demo.jl

Project Structure

SORN/
├── src/
│   ├── SNN.jl           # Main module
│   ├── utils.jl         # Poisson sampling, trace decay
│   ├── neurons.jl       # LIF + Izhikevich pools
│   ├── plasticity.jl    # 5 plasticity mechanisms
│   ├── network.jl       # SORN architecture
│   ├── simulation.jl    # Simulation loop
│   └── encoding.jl      # Input encoding
├── examples/
│   ├── demo.jl          # Full demonstration
│   └── benchmark.jl     # Performance benchmarks
├── Project.toml
└── README.md

Usage

using .SNN
using .SNN.Network: create_sorn
using .SNN.Simulation: simulate!
using .SNN.Encoding: poisson_encode

net = create_sorn(n_exc=80, n_inh=20, n_input=100, seed=42)
input = poisson_encode(100, 1000; rate=0.1)
result = simulate!(net, input; verbose=true)

Use Cases

  • Computational neuroscience research (cortical microcircuit modeling)
  • Neuromorphic computing prototypes
  • Studying emergent memory/sequence learning in recurrent networks
  • Educational tool for spiking neural network dynamics
  • Baseline for comparing plasticity rule combinations

References

  • Lazar et al. (2009) "SORN: a self-organizing recurrent neural network"
  • Turrigiano & Nelson (2000) "Homeostatic plasticity in developing networks"

Releases

No releases published

Packages

 
 
 

Contributors

Languages