Skip to content

George930502/Neocortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NC-1: Multi-Compartment Nodes with Biologically-Stable ODE Dynamics

A biologically-inspired neural network architecture that models cortical pyramidal neurons as multi-compartment computation units, replacing the traditional scalar y = f(Wx + b) neuron with a two-layer micro-network: channel-level sub-integration followed by core-level integration.

Built on 121 peer-reviewed neuroscience papers (2019-2026). Part of a planned 3-paper NeurIPS series.

Key Ideas

Feature Traditional DL NC-1
Neuron model Scalar function Multi-compartment ODE node
Activation Dense (all neurons fire) k-WTA sparse (2-5%)
Signal routing Single path Separate feedforward/feedback channels
Synapse Static weight Conductance-based with short-term plasticity
Connectivity Unconstrained Dale's law (excitatory/inhibitory separation)
Integration Discrete step Exponential Euler ODE solver

Project Structure

nc1/
├── nc1/                          # Main package
│   ├── core/                     # ODE integrators, nonlinearities
│   │   ├── channel_state.py      # Channel-level dynamics
│   │   ├── core_integrator.py    # Soma-level ODE integration
│   │   ├── integrators.py        # Exponential Euler solver
│   │   └── nonlinearities.py     # Activation functions
│   ├── neuron/                   # Neuron models
│   │   ├── multi_channel_node.py # The core computation unit
│   │   ├── quadratic_integrator.py
│   │   ├── backprop_pulse.py     # Back-propagating action potential
│   │   └── dale_constraint.py    # Dale's law enforcement
│   ├── synapse/                  # Synaptic models
│   │   ├── conductance.py        # Conductance-based synapses
│   │   ├── stp.py                # Short-term plasticity
│   │   ├── synaptic_input.py     # Input processing
│   │   └── connection_state.py   # 11-dim connection state vector
│   ├── layers/                   # Layer abstractions
│   │   ├── node_layer.py         # Vectorized multi-node layer
│   │   ├── kwta.py               # k-Winners-Take-All sparse activation
│   │   └── sparse_linear.py      # Sparse connectivity
│   ├── models/                   # Full models
│   │   └── nc1_sequence.py       # Sequence model for benchmarking
│   ├── utils/                    # State containers
│   └── constants.py              # Default parameters
├── experiments/paper1/           # Benchmark experiments
├── tests/paper1/                 # Test suite
├── docs/                         # Research documentation
└── pyproject.toml

Requirements

  • Python >= 3.11
  • PyTorch >= 2.0
  • NumPy >= 1.24
  • torchvision >= 0.15

Setup

# Clone the repository
git clone git@github.com:20iterations/Neocortex.git
cd Neocortex

# Create virtual environment and install dependencies
uv sync

# Or with pip
pip install -e ".[dev]"

Running Tests

# Run all tests
uv run pytest

# Run with verbose output
uv run pytest -v --tb=short

Running Benchmarks

uv run python -m experiments.paper1.benchmarks

Documentation

Research reports and technical analysis are in docs/:

Document Description
NC1 Technical Analysis Deep-dive implementation analysis of Paper 1
Full Vision Complete 3-paper series roadmap and architecture overview
Architecture Plan 10-module implementation plan from biological first principles
Neurobiology Survey Survey of bio-inspired architecture literature
Neuronal Signaling Literature review on signaling, synaptic transmission, and plasticity
Progress Report Current status and benchmark results

Architecture Overview

Input
  │
  ▼
┌─────────────────────────────┐
│  Encoder (Linear → hidden)  │
└──────────────┬──────────────┘
               │
               ▼
┌─────────────────────────────┐
│       NodeLayer Stack       │  × n_layers
│  ┌───────────────────────┐  │
│  │  MultiChannelNode     │  │
│  │  ┌─────┐   ┌──────┐  │  │
│  │  │ FF  │   │  FB  │  │  │  ← Separate feedforward/feedback channels
│  │  │Chan.│   │Chan. │  │  │
│  │  └──┬──┘   └──┬───┘  │  │
│  │     └────┬────┘       │  │
│  │     ┌────▼────┐       │  │
│  │     │  Core   │       │  │  ← ODE integration (exponential Euler)
│  │     │Integr.  │       │  │
│  │     └────┬────┘       │  │
│  │          ▼            │  │
│  │     Spike output      │  │
│  └───────────────────────┘  │
│             │               │
│        k-WTA Sparse         │  ← Only top-k% neurons active
│        Activation           │
└──────────────┬──────────────┘
               │
               ▼
┌─────────────────────────────┐
│   Readout (Linear → output) │
└─────────────────────────────┘

License

All rights reserved.

About

NC-1: Multi-Compartment Nodes with Biologically-Stable ODE Dynamics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages