Skip to main content

A lightweight Spiking Neural Network engine based on Liquid State Machine

Project description

SARA Engine (Liquid Harmony)

SARA (Spiking Advanced Recursive Architecture) is a next-generation AI engine (SNN-based) that mimics the biological brain's "power efficiency, event-driven processing, and self-organization."

It completely eliminates the "backpropagation (BP)" and "matrix operations" that modern deep learning (ANNs) rely on, achieving advanced recognition and learning capabilities using only sparse spike communication.

It operates on CPU only, without using any GPU.

Current Version: v35.1 (Code Name: Liquid Harmony)

Features

  • No Backpropagation: Learns without error backpropagation, using local learning rules (Momentum Delta) and reservoir computing.
  • CPU Only & Lightweight: Does not require expensive GPU resources. Runs fast on standard CPU environments.
  • Multi-Scale True Liquid Reservoir: Three parallel reservoir layers with different temporal characteristics (Decay), with recurrent connections within each layer. Achieves short-term memory using information "echo."
  • Sleep Phase: Implements a "sleep phase" between learning epochs to physically prune unnecessary synapses, preventing overfitting.

Installation

pip install sara-engine

Quick Start

from sara_engine import SaraEngine

# 1. Initialize the engine (input: 784, output: 10 classes)
engine = SaraEngine(input_size=784, output_size=10)

# 2. Prepare data (Poisson-encoded spike train)
# spike_train = [[neuron_idx, ...], [], [neuron_idx], ...]
# ... (See examples/train_mnist.py for data preparation details)

# 3. Training (No GPU required, runs on CPU)
# target_label: index of the correct class
engine.train_step(spike_train, target_label=1)

# 4. Inference
prediction = engine.predict(spike_train)

Architecture (v35.1)

SARA mimics the cortical structure of the brain and has three Reservoir layers:

Layer Type Neuron Count Decay Rate Role Recurrent Connection Strength
Fast 1,500 0.3 (Fast) Edge detection, noise processing 1.2 (Medium)
Medium 2,000 0.7 (Medium) Shape and stroke integration 1.5 (Strong)
Slow 1,500 0.95 (Slow) Context and global pattern retention 2.0 (Strongest)

Processing Flow

graph TD
    Image["Image / Sensor"] -->|Poisson Encoding| Spikes
    Spikes --> Fast["Fast Reservoir"]
    Spikes --> Med["Medium Reservoir"]
    Spikes --> Slow["Slow Reservoir"]
    
    Fast <--> Fast
    Med <--> Med
    Slow <--> Slow
    
    Fast --> Readout
    Med --> Readout
    Slow --> Readout
    
    Readout -->|Momentum Delta| Class

Recommended Parameters (Best Practice)

Golden ratios for MNIST tasks:

  • Samples: 20,000 (minimum baseline)
  • Reservoir Size: 5,000 neurons (Fast: 1500, Med: 2000, Slow: 1500)
  • Input Scale: Strong input to Fast layer (1.0), weak input to Slow layer (0.4)
  • Sleep Pruning: 5% (recommended to execute every epoch)

License

MIT License

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

sara_engine-0.1.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

sara_engine-0.1.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file sara_engine-0.1.1.tar.gz.

File metadata

  • Download URL: sara_engine-0.1.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for sara_engine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d8295b9eb2f9713cde0a65a6859fafdff1ca6ec4f4e82f2fe65e293786d057bd
MD5 612ae23d00fccf174775dc81ae2b3224
BLAKE2b-256 bc1d907a9042ca5fb5d8d6d24541763e464078f95931700c4581a746ef085cf2

See more details on using hashes here.

File details

Details for the file sara_engine-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sara_engine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for sara_engine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f251d405ce37f0abfc8f0d1b87e795a7fded05c753baebabd621a25b10caa303
MD5 98066d6a0669f21c2e864691a3769a1e
BLAKE2b-256 31308ece21ec2a64159e970599371bd31d3d301447ac78f5646627ca400ca77d

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