Skip to main content

Python Neuro-Glia Networks - 3GSNN-LSM Architecture

Project description

pyngn: Python Neuro-Glia Networks

pyngn (Python Neuro-Glia Networks) is a high-performance framework dedicated to Gliomorphic Computing, implementing the novel 3GSNN-LSM (Triglial Spiking Neural Network - Liquid State Machine) architecture.

What is 3GSNN-LSM?

Unlike traditional Spiking Neural Networks that rely solely on neuronal activity, the 3GSNN-LSM model integrates a complex synaptic dynamic by orchestrating the interaction between fast-spiking neurons and three distinct glial agents:

  • Astrocytes: For homeostatic gain control and memory reverberation.
  • Oligodendrocytes: For adaptive temporal delays.
  • Microglia: For structural plasticity and topological pruning.

This bio-inspired synergy allows pyngn to generate self-organizing, energy-efficient reservoirs capable of complex temporal processing and continuous adaptation, bridging the gap between biological plausibility and computational efficiency without relying on backpropagation through time.

Dynamics

The system is modeled as a Dynamic Directed Weighted Graph $\mathcal{G}(t)$ in 3D space.

1. Neural Dynamics (LIF)

The reservoir uses the Leaky Integrate-and-Fire model with a "Pentasynaptic Current" that integrates all glial contributions:

$$ \tau_m \frac{du_i(t)}{dt} = -(u_i(t) - u_{rest}) + R \cdot I_{total}(i, t) $$

$$ I_{total}(i, t) = I_{ext}(i, t) + \underbrace{\gamma_i(t)}{\text{Astrocyte}} \cdot \sum{j} \underbrace{M_{ij}(t)}{\text{Microglia}} \cdot w{ij} \cdot \underbrace{s_j(t - D_{ij}(t))}_{\text{Oligodendrocyte}} $$

2. Glial Dynamics

  • Astrocytes (Homeostasis): Regulate gain $\gamma_i$ based on calcium integration to maintain the reservoir at the "Edge of Chaos".

    $$ \gamma_i(t+1) = \gamma_i(t) + \eta_{astro} \cdot (\rho_{target} - c_i(t)) $$

  • Oligodendrocytes (Delays): Adjust conduction delays $D_{ij}$ to create temporal diversity and memory.

  • Microglia (Pruning): Optimize topology $M_{ij}$ by pruning energy-inefficient synapses based on Hebbian-like health tracking.

Project Structure

pyngn-project/
├── pyngn/                  # Core System Source Code
│   ├── __init__.py
│   ├── neuron.py           # LIF Dynamics and Base Tensors
│   ├── glia.py             # Glial Controllers (Astro, Oligo, Micro)
│   ├── synapse.py          # Weight Management and Delay Buffers
│   ├── reservoir.py        # Orchestrator Class (3GSNN)
│   └── readout.py          # Readout Layer (Ridge Regression/Delta)
├── tests/                  # Unit Tests (pytest)
├── notebooks/              # Experimentation and Benchmarks
├── pyproject.toml          # Build Configuration
└── README.md

Installation

pip install pyngn

Basic Usage

Here is a simple example demonstrating a layer of LIF neurons with synaptic delays (Oligodendrocytes):

import torch
from pyngn.neuron import LIFLayer
from pyngn.synapse import DelayBuffer

# 1. Initialize Layers
n_neurons = 5
# Create a layer of 5 LIF neurons
layer = LIFLayer(n_neurons=n_neurons, tau_m=20.0, v_th=1.0)
# Create a delay buffer for these neurons
buffer = DelayBuffer(n_neurons=n_neurons, max_delay=10)

# 2. Define Connectivity and Delays
# Example: 5 neurons, each connected to others with specific delays
# Here we simulate a dummy delay matrix for demonstration
delays = torch.randint(1, 10, (n_neurons, n_neurons))

# 3. Simulation Loop
for t in range(100):
    # Retrieve delayed spikes from the past based on the delay matrix
    delayed_spikes = buffer.get_delayed_spikes(delays)
    
    # Calculate input current
    # Summing spikes from pre-synaptic neurons (simplified weight=1.0)
    i_syn = delayed_spikes.sum(dim=0) 
    
    # Update neuron state
    spikes = layer.forward(i_syn=i_syn)
    
    # Push new spikes to buffer
    buffer.push(spikes)
    
    if t % 10 == 0:
        print(f"Time {t}: Active Neurons {spikes.sum().item()}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyngn-0.4.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyngn-0.4.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file pyngn-0.4.0.tar.gz.

File metadata

  • Download URL: pyngn-0.4.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0a7

File hashes

Hashes for pyngn-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c406660c54b537d3e0077702a279abb0994a4af8b4068c9ccbdec9728a5e8733
MD5 5077ced8164a5086ed77354404836cbb
BLAKE2b-256 ff1319c8f6d8e3d380ac4a6f3727862076488338d00379c701e08ededf897320

See more details on using hashes here.

File details

Details for the file pyngn-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pyngn-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0a7

File hashes

Hashes for pyngn-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7318f4c96cf65cc19694c1b6d3bd49c261f0dfdfd69eeab5e6c63888242f74
MD5 773b366d38cc89380bd68f48d5691200
BLAKE2b-256 6291c5185ca6e4dfe2820496d8b926398d933951c7d7f112ed7107df4e8f28b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page