A cutting-edge implementation combining Liquid Neural Networks (LNNs) with Spiking Neural Networks (SNNs) for efficient, adaptive AI processing. This hybrid architecture achieves superior performance with dramatically reduced parameters while maintaining biological inspiration and energy efficiency.
# Clone and navigate to project
git clone <repository-url>
cd ssn-cfc
# Create and activate virtual environment
python -m venv nn
source nn/bin/activate # On Windows: nn\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Quick LLM training with default settings
python scripts/cli.py train --task llm --epochs 15
# Quick Vision training with real datasets
python scripts/cli.py train --task vision --epochs 20
# Quick Robotics training with real sensor data
python scripts/cli.py train --task robotics --epochs 30
# Multi-GPU training (auto-detect all available GPUs)
python scripts/cli.py train --task llm --epochs 15 --multi-gpu
# Multi-GPU training with specific GPUs
python scripts/cli.py train --task vision --gpu-strategy dp --gpu-ids "0,1,2"
# Advanced LLM training with custom parameters
python scripts/cli.py train --task llm --liquid-units 384 --spiking-units 192 \
--num-layers 8 --hidden-dim 640 --num-attention-heads 10 --epochs 60
ssn-cfc/
├── src/ # Core source code
│ ├── core/ # Main neural network implementation
│ │ └── main.py # Hybrid network architecture & training
│ ├── datasets/ # Dataset loading and processing
│ │ ├── advanced_programming_datasets.py # LLM: Real programming datasets
│ │ ├── vision_datasets.py # Vision: Real computer vision datasets
│ │ ├── robotics_datasets.py # Robotics: Real sensor & control data
│ │ └── __init__.py # Dataset module exports
│ └── training/ # Training utilities (legacy)
├── scripts/ # Utility scripts
│ └── cli.py # Main command-line interface
├── tests/ # Comprehensive test suite
│ ├── test_real_datasets.py # Real dataset validation tests
│ ├── test_training_pipeline.py # End-to-end training tests
│ └── test_*.py # Additional test modules
├── models/ # Saved model checkpoints
├── cache/ # Dataset and computation cache
├── experiments/ # Experimental results and configs
├── docs/ # Additional documentation
├── data/ # Raw data storage
├── nn/ # Python virtual environment
├── requirements.txt # Python dependencies
├── PARAMETER_CONFIGURABILITY_DEMO.md # Configuration guide
└── README.md # This file
Our system combines two complementary neural paradigms:
τ_m * dV/dt = -(V - V_rest) + R_m * I(t)
if V >= V_threshold: emit spike, V = V_reset
dx/dt = f_θ(x, I(t), τ(t))
τ(t) = sigmoid(W_τ * I(t)) # Adaptive time constant
Input → [Spike Encoding] → [Hybrid Blocks] → [Attention] → [Task Head] → Output
↓ ↓ ↓
Spike trains Liquid+Spike fusion Spike-based attention
LLM Datasets (Real Programming Code):
Vision Datasets (Real Computer Vision):
Robotics Datasets (Real Sensor & Control Data):
The system automatically detects and configures available GPUs for optimal training performance:
# Check available GPUs
python scripts/cli.py info --gpu
# Show system and GPU information
python multi_gpu_demo.py --show-gpu-info
Automatic Strategy Selection (Recommended):
# Auto-detect and use all available GPUs with optimal strategy
python scripts/cli.py train --task llm --epochs 15 --multi-gpu
DataParallel (2-4 GPUs):
# Use DataParallel with specific GPUs
python scripts/cli.py train --task vision --gpu-strategy dp --gpu-ids "0,1,2"
# DataParallel with all available GPUs
python scripts/cli.py train --task robotics --gpu-strategy dp --multi-gpu
DistributedDataParallel (4+ GPUs, Recommended for Large Scale):
# Use DistributedDataParallel for maximum efficiency
python scripts/cli.py train --task llm --gpu-strategy ddp --multi-gpu
# DDP with specific GPUs and custom settings
python scripts/cli.py train --task vision --gpu-strategy ddp --gpu-ids "0,1,2,3" \
--batch-size 64 --sync-batchnorm
Basic Options:
--multi-gpu: Enable multi-GPU training with auto-detection--gpu-strategy: Choose strategy (auto, dp, ddp, none)--gpu-ids: Specify GPU IDs (e.g., "0,1,2,3")Advanced Options:
--distributed-backend: Backend for distributed training (nccl, gloo)--sync-batchnorm: Synchronized batch normalization (recommended for DDP)--no-sync-batchnorm: Disable synchronized batch normalizationBatch Size Scaling: The system automatically adjusts batch sizes for multi-GPU training:
Expected Speedup:
Memory Optimization:
# Use mixed precision for memory efficiency
python scripts/cli.py train --task llm --multi-gpu --mixed-precision
# Adjust batch size for GPU memory
python scripts/cli.py train --task vision --multi-gpu --batch-size 32
Run the comprehensive multi-GPU demo:
# Interactive demo with GPU detection
python multi_gpu_demo.py --show-gpu-info
# Quick multi-GPU training demo
python multi_gpu_demo.py --task llm --epochs 5
# Advanced multi-GPU demo with specific configuration
python multi_gpu_demo.py --task vision --gpu-strategy ddp --gpu-ids "0,1,2,3" --epochs 10
Common Issues:
CUDA Out of Memory:
# Reduce batch size
python scripts/cli.py train --task llm --multi-gpu --batch-size 16
# Enable mixed precision
python scripts/cli.py train --task llm --multi-gpu --mixed-precision
GPU Compatibility:
# Check GPU compatibility
python scripts/cli.py info --gpu
# Use specific compatible GPUs
python scripts/cli.py train --task vision --gpu-ids "0,1" # Skip incompatible GPUs
Performance Issues:
# Use DistributedDataParallel for better scaling
python scripts/cli.py train --task robotics --gpu-strategy ddp --multi-gpu
# Enable synchronization optimizations
python scripts/cli.py train --task llm --gpu-strategy ddp --sync-batchnorm
Requirements for Multi-GPU Training:
# Core dependencies
pip install torch>=2.0.0 torchvision>=0.15.0
pip install snntorch==0.9.1
pip install ncps>=0.0.1
pip install transformers datasets
pip install numpy pandas matplotlib tqdm
# Optional for enhanced performance
pip install ninja tensorboard rich psutil
git clone <repository-url>
cd ssn-cfc
# Verify the installation (recommended after cloning)
python verify_setup.py
# Option 1: Automated installation (recommended)
chmod +x install_dependencies.sh
./install_dependencies.sh
# Option 2: Manual installation
python -m venv nn
source nn/bin/activate # On Windows: nn\Scripts\activate
pip install -r requirements.txt
# Test the installation
python scripts/cli.py info --system
Basic Training Commands:
# LLM Training (Real Programming Datasets)
python scripts/cli.py train --task llm --epochs 15 --batch-size 16
# Vision Training (Real Computer Vision Datasets)
python scripts/cli.py train --task vision --epochs 20 --batch-size 128
# Robotics Training (Real Sensor & Control Data)
python scripts/cli.py train --task robotics --epochs 30 --batch-size 8
# Advanced LLM Training with Custom Parameters
python scripts/cli.py train --task llm \
--liquid-units 384 --spiking-units 192 \
--num-layers 8 --hidden-dim 640 \
--num-attention-heads 10 --spike-threshold 1.2 \
--beta 0.96 --learning-rate 0.0002 \
--batch-size 12 --epochs 60 \
--sequence-length 64 --mixed-precision \
--save-config my_llm_config.json \
--output-dir ./my_models
Task-Specific Training Examples:
# High-Performance LLM Training
python scripts/cli.py train --task llm \
--liquid-units 512 --spiking-units 256 \
--num-layers 12 --hidden-dim 768 \
--num-attention-heads 12 --batch-size 16 \
--learning-rate 3e-4 --epochs 50 \
--weight-decay 0.01 --gradient-clip 1.0
# Efficient Vision Training
python scripts/cli.py train --task vision \
--liquid-units 256 --spiking-units 128 \
--num-layers 6 --hidden-dim 512 \
--conv-channels "64,128,256" \
--batch-size 64 --learning-rate 1e-3 \
--epochs 25 --dropout 0.15
# Robotics Control Training
python scripts/cli.py train --task robotics \
--liquid-units 128 --spiking-units 64 \
--num-layers 4 --hidden-dim 256 \
--sequence-length 100 --batch-size 16 \
--learning-rate 5e-4 --epochs 40
Save and Load Configurations:
# Save current configuration
python scripts/cli.py train --task llm --save-config my_config.json
# Load and modify saved configuration
python scripts/cli.py train --load-config my_config.json --epochs 30
# Create configuration without training
python scripts/cli.py config --task vision --save-config vision_config.json
# Run inference on trained model
python scripts/cli.py inference --model-path models/llm_final.pt
# Benchmark model performance
python scripts/cli.py benchmark --model-path models/vision_final.pt
# Export model to different formats
python scripts/cli.py export --model-path models/robotics_final.pt --format onnx
# Import the core system
from src.core.main import ModelConfig, TaskType, LiquidSpikingNetwork, Trainer
# Create custom configuration
config = ModelConfig(
task_type=TaskType.LLM,
input_dim=512,
hidden_dim=640,
output_dim=50257, # GPT-2 vocabulary size
liquid_units=384,
spiking_units=192,
num_layers=8,
num_attention_heads=10, # Will auto-adjust to compatible value
spike_threshold=1.2,
beta=0.96,
learning_rate=2e-4,
batch_size=12,
sequence_length=64,
dropout=0.1,
mixed_precision=True,
device='cuda',
num_epochs=60
)
# Create and train model
model = LiquidSpikingNetwork(config)
trainer = Trainer(model, config)
trainer.train()
from src.core.main import load_model, generate_text
from transformers import AutoTokenizer
# Load trained model
model, config = load_model("models/llm_final.pt", TaskType.LLM)
tokenizer = AutoTokenizer.from_pretrained('gpt2')
# Generate code
generated = generate_text(
model, config, tokenizer,
prompt="def fibonacci(n):",
max_length=100,
temperature=0.7
)
print(generated)
from src.core.main import load_model, TaskType
import torch
# Load vision model
model, config = load_model("models/vision_final.pt", TaskType.VISION)
# Classify image
image = torch.randn(1, 3, 32, 32) # CIFAR-10 format
with torch.no_grad():
predictions = model(image)
predicted_class = torch.argmax(predictions, dim=-1)
# Test the mixed dataset functionality
python tests/test_dataset_integration.py
The system supports over 40 configurable parameters through CLI arguments and configuration files:
| Parameter | Range/Options | Default | Purpose | Task Relevance |
|---|---|---|---|---|
| Core Architecture | ||||
liquid_units | 64-1024 | 256 | Liquid neural network capacity | All tasks |
spiking_units | 32-512 | 128 | Spike encoder dimension | All tasks |
num_layers | 2-16 | 6 | Network depth | All tasks |
hidden_dim | 128-2048 | 512 | Hidden layer dimension | All tasks |
input_dim | Auto-calculated | - | Input dimension (task-specific) | All tasks |
output_dim | Auto-calculated | - | Output dimension (task-specific) | All tasks |
| Liquid Neural Network | ||||
liquid_backbone | cfc, ltc, ncp | cfc | Liquid NN type | All tasks |
| Spiking Neural Network | ||||
spike_threshold | 0.5-3.0 | 1.0 | Neuron firing threshold | All tasks |
beta | 0.8-0.99 | 0.95 | Membrane potential decay | All tasks |
num_spike_steps | 4-128 | 32 | Spiking time steps | All tasks |
| Attention Mechanism | ||||
num_attention_heads | 1-32 | 8 | Multi-head attention heads | All tasks |
attention_dropout | 0.0-0.5 | 0.1 | Attention dropout rate | All tasks |
| Language Model (LLM) | ||||
vocab_size | - | 50257 | Vocabulary size | LLM only |
embedding_dim | 128-1024 | 512 | Token embedding dimension | LLM only |
max_position_embeddings | 64-2048 | 512 | Maximum sequence positions | LLM only |
sequence_length | 32-1024 | 128 | Input sequence length | LLM only |
embedding_dropout | 0.0-0.3 | 0.1 | Embedding dropout rate | LLM only |
| Vision Model | ||||
conv_channels | e.g., "32,64,128" | "32,64,128" | Convolutional channels | Vision only |
conv_kernel_sizes | e.g., "3,3,3" | "3,3,3" | Convolution kernel sizes | Vision only |
conv_strides | e.g., "1,2,2" | "1,1,1" | Convolution strides | Vision only |
conv_padding | e.g., "1,1,1" | "1,1,1" | Convolution padding | Vision only |
| Training Parameters | ||||
learning_rate | 1e-5 to 1e-2 | 1e-4 | Optimizer learning rate | All tasks |
batch_size | 1-512 | 32 | Training batch size | All tasks |
num_epochs | 1-1000 | 15 | Training epochs | All tasks |
weight_decay | 0.0-0.1 | 0.01 | L2 regularization | All tasks |
gradient_clip | 0.1-10.0 | 1.0 | Gradient clipping threshold | All tasks |
dropout | 0.0-0.5 | 0.1 | General dropout rate | All tasks |
mixed_precision | true/false | true | 16-bit training | All tasks |
| Advanced Parameters | ||||
layer_norm_eps | 1e-8 to 1e-4 | 1e-5 | Layer normalization epsilon | All tasks |
initializer_range | 0.01-0.1 | 0.02 | Weight initialization range | All tasks |
use_cache | true/false | true | Enable model caching | All tasks |
device | cpu/cuda | cuda | Training device | All tasks |
seed | 0-99999 | 42 | Random seed | All tasks |
The system automatically handles parameter compatibility:
hidden_dim is not divisible by num_attention_heads, the system automatically adjusts to the nearest compatible valuessequence_length // 4hidden_dim, liquid_units, spiking_units)learning_rate, batch_size, epochs)dropout, weight_decay)gradient_clip, mixed_precision)beta, spike_threshold, num_spike_steps)num_attention_heads, attention_dropout)num_layers)High-Performance LLM:
--liquid-units 512 --spiking-units 256 --num-layers 12 --hidden-dim 768
--num-attention-heads 12 --sequence-length 128 --batch-size 16
Efficient Vision:
--liquid-units 256 --spiking-units 128 --num-layers 6 --hidden-dim 512
--conv-channels "64,128,256" --batch-size 64
Robotics Control:
--liquid-units 128 --spiking-units 64 --num-layers 4 --hidden-dim 256
--sequence-length 100 --batch-size 16
Based on research from MIT's Computer Science and Artificial Intelligence Laboratory (CSAIL):
Implementing third-generation neural networks:
Novel combination achieving:
Missing Dependencies:
# Install core dependencies
pip install torch>=2.0.0 torchvision>=0.15.0
pip install snntorch==0.9.1 ncps>=0.0.1
pip install transformers datasets
pip install numpy pandas matplotlib tqdm rich
# Install robotics-specific dependencies
pip install scipy opencv-python-headless h5py
# Install optional performance packages
pip install ninja tensorboard psutil
OpenCV Installation Issues (Docker/Server environments):
# Try headless version first (recommended for servers)
pip install opencv-python-headless>=4.5.0
# If that fails, try standard version
pip install opencv-python>=4.5.0
# For Ubuntu/Debian systems, install system dependencies
sudo apt-get update
sudo apt-get install libgl1-mesa-glx libglib2.0-0
# Use automated installer script
chmod +x install_dependencies.sh
./install_dependencies.sh
CUDA/GPU Issues:
# Check CUDA availability
python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
# Force CPU training if GPU issues
python scripts/cli.py train --task llm --device cpu --batch-size 8
# Check GPU memory
python scripts/cli.py info --gpu
Memory Errors:
# Reduce batch size
python scripts/cli.py train --task llm --batch-size 4
# Use gradient accumulation for effective larger batches
python scripts/cli.py train --task vision \
--batch-size 16 --gradient-accumulation-steps 4
# Reduce model size
python scripts/cli.py train --task robotics \
--liquid-units 64 --spiking-units 32 --num-layers 3
Dimension Mismatch Errors:
The system automatically handles most dimension mismatches, but if you see errors like:
RuntimeError: shape '[X, Y, Z, W]' is invalid for input of size N
Solutions:
num_attention_heads to be compatible with hidden_dimhidden_dim is divisible by num_attention_heads if manually setPoor Convergence:
# Adjust learning rate
python scripts/cli.py train --task llm --learning-rate 5e-5
# Use learning rate scheduling (automatic in advanced configs)
python scripts/cli.py train --task vision \
--learning-rate 1e-3 --weight-decay 0.01
# Check gradient clipping
python scripts/cli.py train --task robotics \
--gradient-clip 0.5 --mixed-precision false
Dataset Loading Issues:
# Clear cache and reload datasets
rm -rf cache/ programming_dataset_cache/ test_cache/
# Test dataset integrity
python test_real_datasets.py
# Verify no mock data is being used
python scripts/cli.py info --datasets --verify-real-data
Speed Optimization:
# Enable mixed precision (default)
python scripts/cli.py train --task llm --mixed-precision
# Use optimal batch sizes for your GPU
python scripts/cli.py train --task vision --batch-size 64 # For 8GB GPU
python scripts/cli.py train --task vision --batch-size 128 # For 16GB+ GPU
# Enable model compilation (PyTorch 2.0+)
python scripts/cli.py train --task robotics --compile-model
Memory Optimization:
# Use CPU offloading for large models
python scripts/cli.py train --task llm \
--cpu-offload --batch-size 8
# Reduce precision for embeddings
python scripts/cli.py train --task llm \
--embedding-precision float16
Test Real Dataset Usage:
# Comprehensive dataset validation
python test_real_datasets.py
# Expected output: "📊 TEST RESULTS: 4/4 tests passed"
# Training pipeline validation
python test_training_pipeline.py
# Expected output: "✅ ALL TRAINING PIPELINE TESTS PASSED!"
# Verify dataset composition
python scripts/cli.py info --datasets
Model Architecture Validation:
# Check model parameter count
python scripts/cli.py info --model-path ./models/llm_final.pt
# Validate gradient flow
python scripts/cli.py train --task vision --epochs 1 --debug-gradients
# Test forward pass
python scripts/cli.py inference --model-path ./models/robotics_final.pt --test-forward
Check System Requirements:
# Comprehensive system check
python scripts/cli.py info --system
# Check Python environment
python scripts/cli.py info --environment
# Validate installation
python scripts/cli.py info --test-installation
Debug Training Process:
# Enable verbose logging
python scripts/cli.py train --task llm --verbose --log-level DEBUG
# Save intermediate outputs
python scripts/cli.py train --task vision \
--debug-mode --save-intermediate-outputs
# Monitor resource usage
python scripts/cli.py train --task robotics --monitor-resources
Issue: Attention Dimension Mismatch
RuntimeError: shape '[batch, seq, heads, dim]' is invalidhidden_dim not divisible by num_attention_headsIssue: Dataset Download Timeouts
--force-reloadIssue: CUDA Out of Memory
RuntimeError: CUDA out of memory--batch-size or use --gradient-accumulation-stepsIssue: Slow Training on CPU
Community Resources:
/docs folder/experiments folder/tests folderDebug Information to Include:
When reporting issues, please include:
# System information
python scripts/cli.py info --system --gpu --environment
# Error logs with full traceback
python scripts/cli.py train --task <task> --verbose 2>&1 | tee debug.log
# Model configuration
cat your_config.json
# Dataset validation results
python test_real_datasets.py
Start Training Immediately:
# Quick LLM training (15 epochs, real programming datasets)
python scripts/cli.py train --task llm --epochs 15
# Quick Vision training (20 epochs, real computer vision datasets)
python scripts/cli.py train --task vision --epochs 20
# Quick Robotics training (30 epochs, real sensor data)
python scripts/cli.py train --task robotics --epochs 30
High-Performance LLM Training:
python scripts/cli.py train --task llm \
--liquid-units 512 --spiking-units 256 \
--num-layers 12 --hidden-dim 768 \
--num-attention-heads 12 --spike-threshold 1.1 \
--beta 0.97 --learning-rate 2e-4 \
--batch-size 16 --epochs 50 \
--sequence-length 128 --mixed-precision \
--weight-decay 0.01 --gradient-clip 1.0 \
--save-config production_llm.json \
--output-dir ./production_models/llm
Optimized Vision Training:
python scripts/cli.py train --task vision \
--liquid-units 256 --spiking-units 128 \
--num-layers 8 --hidden-dim 512 \
--conv-channels "64,128,256,512" \
--conv-kernel-sizes "3,3,3,3" \
--conv-strides "1,2,2,2" \
--batch-size 64 --learning-rate 1e-3 \
--epochs 40 --dropout 0.15 \
--save-config production_vision.json \
--output-dir ./production_models/vision
Robotics Control Training:
python scripts/cli.py train --task robotics \
--liquid-units 128 --spiking-units 64 \
--num-layers 6 --hidden-dim 256 \
--sequence-length 100 --batch-size 16 \
--learning-rate 5e-4 --epochs 50 \
--spike-threshold 1.0 --beta 0.95 \
--save-config production_robotics.json \
--output-dir ./production_models/robotics
Save and Reuse Configurations:
# Save configuration during training
python scripts/cli.py train --task llm --save-config my_llm_setup.json
# Load and modify existing configuration
python scripts/cli.py train --load-config my_llm_setup.json \
--epochs 100 --learning-rate 1e-4
# Create configuration file without training
python scripts/cli.py config --task vision \
--save-config vision_baseline.json \
--liquid-units 256 --batch-size 128
# Train with pre-configured settings
python scripts/cli.py train --load-config vision_baseline.json
Model Inference and Testing:
# Basic model inference (generates sample outputs)
python scripts/cli.py inference --model-path ./models/llm_final.pt
# Inference with custom input
python scripts/cli.py inference \
--model-path ./models/vision_final.pt \
--input-file test_images.npy
# Batch inference for evaluation
python scripts/cli.py inference \
--model-path ./models/robotics_final.pt \
--batch-size 32 --verbose
Performance Benchmarking:
# Basic performance benchmark
python scripts/cli.py benchmark --model-path ./models/llm_final.pt
# Comprehensive benchmarking with detailed metrics
python scripts/cli.py benchmark \
--model-path ./models/vision_final.pt \
--iterations 1000 --batch-size 64 \
--output-file vision_benchmark_results.json
# Compare multiple models
python scripts/cli.py benchmark \
--model-path ./models/robotics_v1.pt \
--model-path ./models/robotics_v2.pt \
--compare-models
Model Export for Deployment:
# Export to ONNX for cross-platform deployment
python scripts/cli.py export \
--model-path ./models/vision_final.pt \
--output-path ./exports/vision_model.onnx \
--format onnx
# Export to TorchScript for PyTorch deployment
python scripts/cli.py export \
--model-path ./models/llm_final.pt \
--output-path ./exports/llm_model.pt \
--format torchscript
# Export with optimization
python scripts/cli.py export \
--model-path ./models/robotics_final.pt \
--output-path ./exports/robotics_optimized.onnx \
--format onnx --optimize
Hyperparameter Search:
#!/bin/bash
# Automated hyperparameter search script
learning_rates=(1e-4 2e-4 3e-4 5e-4)
batch_sizes=(16 32 64)
for lr in "${learning_rates[@]}"; do
for bs in "${batch_sizes[@]}"; do
echo "Training with lr=$lr, batch_size=$bs"
python scripts/cli.py train --task llm \
--learning-rate $lr --batch-size $bs \
--epochs 20 --save-config "config_lr${lr}_bs${bs}.json" \
--output-dir "experiments/lr${lr}_bs${bs}"
done
done
Resume Training from Checkpoints:
# Resume interrupted training
python scripts/cli.py train --task vision \
--resume ./models/vision_epoch_15.pt \
--epochs 30 # Will continue from epoch 15 to 30
# Fine-tune pre-trained model
python scripts/cli.py train --task llm \
--resume ./models/llm_base.pt \
--learning-rate 1e-5 --epochs 10 # Lower LR for fine-tuning
Training Diagnostics:
# Training with verbose output and monitoring
python scripts/cli.py train --task robotics \
--epochs 50 --verbose \
--save-interval 5 # Save checkpoint every 5 epochs
--log-interval 100 # Log every 100 batches
# Check model information
python scripts/cli.py info --model-path ./models/llm_final.pt
# Monitor training status
python scripts/cli.py status --output-dir ./models/current_training
System Information:
# Check system compatibility
python scripts/cli.py info --system
# Check GPU availability and memory
python scripts/cli.py info --gpu
# Test installation
python scripts/cli.py info --test-installation
Verify Real Datasets Are Being Used:
# Test dataset integrity (verifies no mock/synthetic data)
python test_real_datasets.py
# Validate complete training pipeline with real data
python test_training_pipeline.py
# Check dataset statistics
python scripts/cli.py info --datasets
If using this code for research, please cite:
@software{hybrid_liquid_spiking_2024,
title={Hybrid Liquid-Spiking Neural Network System},
author={Your Name},
year={2024},
url={https://github.com/yourusername/ssn-cfc}
}
git checkout -b feature-name# Install development dependencies
pip install -e .
pip install pytest black flake8 mypy
# Run tests
pytest tests/
# Format code
black src/ tests/ scripts/
# Type checking
mypy src/
MIT License - See LICENSE file for details.
/docs folder and this README/experiments folder/tests folder for validation✅ Completed Features:
🔄 In Progress:
📋 Planned Features:
Technical Milestones:
Performance Highlights:
Built with ❤️ for the future of efficient, biological AI
This project represents a significant advancement in neural network efficiency and capability, combining the best aspects of biological neural computation with modern machine learning techniques. The hybrid approach opens new possibilities for energy-efficient AI deployment across diverse applications from edge devices to large-scale systems.
The implementation prioritizes real-world applicability with comprehensive real datasets, avoiding shortcuts or mock data that could compromise model performance in production environments. Every component has been designed for both research exploration and practical deployment.
5 commits
Python
99.5%
A cutting-edge implementation combining Liquid Neural Networks (LNNs) with Spiking Neural Networks (SNNs) for efficient, adaptive AI processing. This hybrid architecture achieves superior performance with dramatically reduced parameters while maintaining biological inspiration and energy efficiency.
# Clone and navigate to project
git clone <repository-url>
cd ssn-cfc
# Create and activate virtual environment
python -m venv nn
source nn/bin/activate # On Windows: nn\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Quick LLM training with default settings
python scripts/cli.py train --task llm --epochs 15
# Quick Vision training with real datasets
python scripts/cli.py train --task vision --epochs 20
# Quick Robotics training with real sensor data
python scripts/cli.py train --task robotics --epochs 30
# Multi-GPU training (auto-detect all available GPUs)
python scripts/cli.py train --task llm --epochs 15 --multi-gpu
# Multi-GPU training with specific GPUs
python scripts/cli.py train --task vision --gpu-strategy dp --gpu-ids "0,1,2"
# Advanced LLM training with custom parameters
python scripts/cli.py train --task llm --liquid-units 384 --spiking-units 192 \
--num-layers 8 --hidden-dim 640 --num-attention-heads 10 --epochs 60
ssn-cfc/
├── src/ # Core source code
│ ├── core/ # Main neural network implementation
│ │ └── main.py # Hybrid network architecture & training
│ ├── datasets/ # Dataset loading and processing
│ │ ├── advanced_programming_datasets.py # LLM: Real programming datasets
│ │ ├── vision_datasets.py # Vision: Real computer vision datasets
│ │ ├── robotics_datasets.py # Robotics: Real sensor & control data
│ │ └── __init__.py # Dataset module exports
│ └── training/ # Training utilities (legacy)
├── scripts/ # Utility scripts
│ └── cli.py # Main command-line interface
├── tests/ # Comprehensive test suite
│ ├── test_real_datasets.py # Real dataset validation tests
│ ├── test_training_pipeline.py # End-to-end training tests
│ └── test_*.py # Additional test modules
├── models/ # Saved model checkpoints
├── cache/ # Dataset and computation cache
├── experiments/ # Experimental results and configs
├── docs/ # Additional documentation
├── data/ # Raw data storage
├── nn/ # Python virtual environment
├── requirements.txt # Python dependencies
├── PARAMETER_CONFIGURABILITY_DEMO.md # Configuration guide
└── README.md # This file
Our system combines two complementary neural paradigms:
τ_m * dV/dt = -(V - V_rest) + R_m * I(t)
if V >= V_threshold: emit spike, V = V_reset
dx/dt = f_θ(x, I(t), τ(t))
τ(t) = sigmoid(W_τ * I(t)) # Adaptive time constant
Input → [Spike Encoding] → [Hybrid Blocks] → [Attention] → [Task Head] → Output
↓ ↓ ↓
Spike trains Liquid+Spike fusion Spike-based attention
LLM Datasets (Real Programming Code):
Vision Datasets (Real Computer Vision):
Robotics Datasets (Real Sensor & Control Data):
The system automatically detects and configures available GPUs for optimal training performance:
# Check available GPUs
python scripts/cli.py info --gpu
# Show system and GPU information
python multi_gpu_demo.py --show-gpu-info
Automatic Strategy Selection (Recommended):
# Auto-detect and use all available GPUs with optimal strategy
python scripts/cli.py train --task llm --epochs 15 --multi-gpu
DataParallel (2-4 GPUs):
# Use DataParallel with specific GPUs
python scripts/cli.py train --task vision --gpu-strategy dp --gpu-ids "0,1,2"
# DataParallel with all available GPUs
python scripts/cli.py train --task robotics --gpu-strategy dp --multi-gpu
DistributedDataParallel (4+ GPUs, Recommended for Large Scale):
# Use DistributedDataParallel for maximum efficiency
python scripts/cli.py train --task llm --gpu-strategy ddp --multi-gpu
# DDP with specific GPUs and custom settings
python scripts/cli.py train --task vision --gpu-strategy ddp --gpu-ids "0,1,2,3" \
--batch-size 64 --sync-batchnorm
Basic Options:
--multi-gpu: Enable multi-GPU training with auto-detection--gpu-strategy: Choose strategy (auto, dp, ddp, none)--gpu-ids: Specify GPU IDs (e.g., "0,1,2,3")Advanced Options:
--distributed-backend: Backend for distributed training (nccl, gloo)--sync-batchnorm: Synchronized batch normalization (recommended for DDP)--no-sync-batchnorm: Disable synchronized batch normalizationBatch Size Scaling: The system automatically adjusts batch sizes for multi-GPU training:
Expected Speedup:
Memory Optimization:
# Use mixed precision for memory efficiency
python scripts/cli.py train --task llm --multi-gpu --mixed-precision
# Adjust batch size for GPU memory
python scripts/cli.py train --task vision --multi-gpu --batch-size 32
Run the comprehensive multi-GPU demo:
# Interactive demo with GPU detection
python multi_gpu_demo.py --show-gpu-info
# Quick multi-GPU training demo
python multi_gpu_demo.py --task llm --epochs 5
# Advanced multi-GPU demo with specific configuration
python multi_gpu_demo.py --task vision --gpu-strategy ddp --gpu-ids "0,1,2,3" --epochs 10
Common Issues:
CUDA Out of Memory:
# Reduce batch size
python scripts/cli.py train --task llm --multi-gpu --batch-size 16
# Enable mixed precision
python scripts/cli.py train --task llm --multi-gpu --mixed-precision
GPU Compatibility:
# Check GPU compatibility
python scripts/cli.py info --gpu
# Use specific compatible GPUs
python scripts/cli.py train --task vision --gpu-ids "0,1" # Skip incompatible GPUs
Performance Issues:
# Use DistributedDataParallel for better scaling
python scripts/cli.py train --task robotics --gpu-strategy ddp --multi-gpu
# Enable synchronization optimizations
python scripts/cli.py train --task llm --gpu-strategy ddp --sync-batchnorm
Requirements for Multi-GPU Training:
# Core dependencies
pip install torch>=2.0.0 torchvision>=0.15.0
pip install snntorch==0.9.1
pip install ncps>=0.0.1
pip install transformers datasets
pip install numpy pandas matplotlib tqdm
# Optional for enhanced performance
pip install ninja tensorboard rich psutil
git clone <repository-url>
cd ssn-cfc
# Verify the installation (recommended after cloning)
python verify_setup.py
# Option 1: Automated installation (recommended)
chmod +x install_dependencies.sh
./install_dependencies.sh
# Option 2: Manual installation
python -m venv nn
source nn/bin/activate # On Windows: nn\Scripts\activate
pip install -r requirements.txt
# Test the installation
python scripts/cli.py info --system
Basic Training Commands:
# LLM Training (Real Programming Datasets)
python scripts/cli.py train --task llm --epochs 15 --batch-size 16
# Vision Training (Real Computer Vision Datasets)
python scripts/cli.py train --task vision --epochs 20 --batch-size 128
# Robotics Training (Real Sensor & Control Data)
python scripts/cli.py train --task robotics --epochs 30 --batch-size 8
# Advanced LLM Training with Custom Parameters
python scripts/cli.py train --task llm \
--liquid-units 384 --spiking-units 192 \
--num-layers 8 --hidden-dim 640 \
--num-attention-heads 10 --spike-threshold 1.2 \
--beta 0.96 --learning-rate 0.0002 \
--batch-size 12 --epochs 60 \
--sequence-length 64 --mixed-precision \
--save-config my_llm_config.json \
--output-dir ./my_models
Task-Specific Training Examples:
# High-Performance LLM Training
python scripts/cli.py train --task llm \
--liquid-units 512 --spiking-units 256 \
--num-layers 12 --hidden-dim 768 \
--num-attention-heads 12 --batch-size 16 \
--learning-rate 3e-4 --epochs 50 \
--weight-decay 0.01 --gradient-clip 1.0
# Efficient Vision Training
python scripts/cli.py train --task vision \
--liquid-units 256 --spiking-units 128 \
--num-layers 6 --hidden-dim 512 \
--conv-channels "64,128,256" \
--batch-size 64 --learning-rate 1e-3 \
--epochs 25 --dropout 0.15
# Robotics Control Training
python scripts/cli.py train --task robotics \
--liquid-units 128 --spiking-units 64 \
--num-layers 4 --hidden-dim 256 \
--sequence-length 100 --batch-size 16 \
--learning-rate 5e-4 --epochs 40
Save and Load Configurations:
# Save current configuration
python scripts/cli.py train --task llm --save-config my_config.json
# Load and modify saved configuration
python scripts/cli.py train --load-config my_config.json --epochs 30
# Create configuration without training
python scripts/cli.py config --task vision --save-config vision_config.json
# Run inference on trained model
python scripts/cli.py inference --model-path models/llm_final.pt
# Benchmark model performance
python scripts/cli.py benchmark --model-path models/vision_final.pt
# Export model to different formats
python scripts/cli.py export --model-path models/robotics_final.pt --format onnx
# Import the core system
from src.core.main import ModelConfig, TaskType, LiquidSpikingNetwork, Trainer
# Create custom configuration
config = ModelConfig(
task_type=TaskType.LLM,
input_dim=512,
hidden_dim=640,
output_dim=50257, # GPT-2 vocabulary size
liquid_units=384,
spiking_units=192,
num_layers=8,
num_attention_heads=10, # Will auto-adjust to compatible value
spike_threshold=1.2,
beta=0.96,
learning_rate=2e-4,
batch_size=12,
sequence_length=64,
dropout=0.1,
mixed_precision=True,
device='cuda',
num_epochs=60
)
# Create and train model
model = LiquidSpikingNetwork(config)
trainer = Trainer(model, config)
trainer.train()
from src.core.main import load_model, generate_text
from transformers import AutoTokenizer
# Load trained model
model, config = load_model("models/llm_final.pt", TaskType.LLM)
tokenizer = AutoTokenizer.from_pretrained('gpt2')
# Generate code
generated = generate_text(
model, config, tokenizer,
prompt="def fibonacci(n):",
max_length=100,
temperature=0.7
)
print(generated)
from src.core.main import load_model, TaskType
import torch
# Load vision model
model, config = load_model("models/vision_final.pt", TaskType.VISION)
# Classify image
image = torch.randn(1, 3, 32, 32) # CIFAR-10 format
with torch.no_grad():
predictions = model(image)
predicted_class = torch.argmax(predictions, dim=-1)
# Test the mixed dataset functionality
python tests/test_dataset_integration.py
The system supports over 40 configurable parameters through CLI arguments and configuration files:
| Parameter | Range/Options | Default | Purpose | Task Relevance |
|---|---|---|---|---|
| Core Architecture | ||||
liquid_units | 64-1024 | 256 | Liquid neural network capacity | All tasks |
spiking_units | 32-512 | 128 | Spike encoder dimension | All tasks |
num_layers | 2-16 | 6 | Network depth | All tasks |
hidden_dim | 128-2048 | 512 | Hidden layer dimension | All tasks |
input_dim | Auto-calculated | - | Input dimension (task-specific) | All tasks |
output_dim | Auto-calculated | - | Output dimension (task-specific) | All tasks |
| Liquid Neural Network | ||||
liquid_backbone | cfc, ltc, ncp | cfc | Liquid NN type | All tasks |
| Spiking Neural Network | ||||
spike_threshold | 0.5-3.0 | 1.0 | Neuron firing threshold | All tasks |
beta | 0.8-0.99 | 0.95 | Membrane potential decay | All tasks |
num_spike_steps | 4-128 | 32 | Spiking time steps | All tasks |
| Attention Mechanism | ||||
num_attention_heads | 1-32 | 8 | Multi-head attention heads | All tasks |
attention_dropout | 0.0-0.5 | 0.1 | Attention dropout rate | All tasks |
| Language Model (LLM) | ||||
vocab_size | - | 50257 | Vocabulary size | LLM only |
embedding_dim | 128-1024 | 512 | Token embedding dimension | LLM only |
max_position_embeddings | 64-2048 | 512 | Maximum sequence positions | LLM only |
sequence_length | 32-1024 | 128 | Input sequence length | LLM only |
embedding_dropout | 0.0-0.3 | 0.1 | Embedding dropout rate | LLM only |
| Vision Model | ||||
conv_channels | e.g., "32,64,128" | "32,64,128" | Convolutional channels | Vision only |
conv_kernel_sizes | e.g., "3,3,3" | "3,3,3" | Convolution kernel sizes | Vision only |
conv_strides | e.g., "1,2,2" | "1,1,1" | Convolution strides | Vision only |
conv_padding | e.g., "1,1,1" | "1,1,1" | Convolution padding | Vision only |
| Training Parameters | ||||
learning_rate | 1e-5 to 1e-2 | 1e-4 | Optimizer learning rate | All tasks |
batch_size | 1-512 | 32 | Training batch size | All tasks |
num_epochs | 1-1000 | 15 | Training epochs | All tasks |
weight_decay | 0.0-0.1 | 0.01 | L2 regularization | All tasks |
gradient_clip | 0.1-10.0 | 1.0 | Gradient clipping threshold | All tasks |
dropout | 0.0-0.5 | 0.1 | General dropout rate | All tasks |
mixed_precision | true/false | true | 16-bit training | All tasks |
| Advanced Parameters | ||||
layer_norm_eps | 1e-8 to 1e-4 | 1e-5 | Layer normalization epsilon | All tasks |
initializer_range | 0.01-0.1 | 0.02 | Weight initialization range | All tasks |
use_cache | true/false | true | Enable model caching | All tasks |
device | cpu/cuda | cuda | Training device | All tasks |
seed | 0-99999 | 42 | Random seed | All tasks |
The system automatically handles parameter compatibility:
hidden_dim is not divisible by num_attention_heads, the system automatically adjusts to the nearest compatible valuessequence_length // 4hidden_dim, liquid_units, spiking_units)learning_rate, batch_size, epochs)dropout, weight_decay)gradient_clip, mixed_precision)beta, spike_threshold, num_spike_steps)num_attention_heads, attention_dropout)num_layers)High-Performance LLM:
--liquid-units 512 --spiking-units 256 --num-layers 12 --hidden-dim 768
--num-attention-heads 12 --sequence-length 128 --batch-size 16
Efficient Vision:
--liquid-units 256 --spiking-units 128 --num-layers 6 --hidden-dim 512
--conv-channels "64,128,256" --batch-size 64
Robotics Control:
--liquid-units 128 --spiking-units 64 --num-layers 4 --hidden-dim 256
--sequence-length 100 --batch-size 16
Based on research from MIT's Computer Science and Artificial Intelligence Laboratory (CSAIL):
Implementing third-generation neural networks:
Novel combination achieving:
Missing Dependencies:
# Install core dependencies
pip install torch>=2.0.0 torchvision>=0.15.0
pip install snntorch==0.9.1 ncps>=0.0.1
pip install transformers datasets
pip install numpy pandas matplotlib tqdm rich
# Install robotics-specific dependencies
pip install scipy opencv-python-headless h5py
# Install optional performance packages
pip install ninja tensorboard psutil
OpenCV Installation Issues (Docker/Server environments):
# Try headless version first (recommended for servers)
pip install opencv-python-headless>=4.5.0
# If that fails, try standard version
pip install opencv-python>=4.5.0
# For Ubuntu/Debian systems, install system dependencies
sudo apt-get update
sudo apt-get install libgl1-mesa-glx libglib2.0-0
# Use automated installer script
chmod +x install_dependencies.sh
./install_dependencies.sh
CUDA/GPU Issues:
# Check CUDA availability
python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
# Force CPU training if GPU issues
python scripts/cli.py train --task llm --device cpu --batch-size 8
# Check GPU memory
python scripts/cli.py info --gpu
Memory Errors:
# Reduce batch size
python scripts/cli.py train --task llm --batch-size 4
# Use gradient accumulation for effective larger batches
python scripts/cli.py train --task vision \
--batch-size 16 --gradient-accumulation-steps 4
# Reduce model size
python scripts/cli.py train --task robotics \
--liquid-units 64 --spiking-units 32 --num-layers 3
Dimension Mismatch Errors:
The system automatically handles most dimension mismatches, but if you see errors like:
RuntimeError: shape '[X, Y, Z, W]' is invalid for input of size N
Solutions:
num_attention_heads to be compatible with hidden_dimhidden_dim is divisible by num_attention_heads if manually setPoor Convergence:
# Adjust learning rate
python scripts/cli.py train --task llm --learning-rate 5e-5
# Use learning rate scheduling (automatic in advanced configs)
python scripts/cli.py train --task vision \
--learning-rate 1e-3 --weight-decay 0.01
# Check gradient clipping
python scripts/cli.py train --task robotics \
--gradient-clip 0.5 --mixed-precision false
Dataset Loading Issues:
# Clear cache and reload datasets
rm -rf cache/ programming_dataset_cache/ test_cache/
# Test dataset integrity
python test_real_datasets.py
# Verify no mock data is being used
python scripts/cli.py info --datasets --verify-real-data
Speed Optimization:
# Enable mixed precision (default)
python scripts/cli.py train --task llm --mixed-precision
# Use optimal batch sizes for your GPU
python scripts/cli.py train --task vision --batch-size 64 # For 8GB GPU
python scripts/cli.py train --task vision --batch-size 128 # For 16GB+ GPU
# Enable model compilation (PyTorch 2.0+)
python scripts/cli.py train --task robotics --compile-model
Memory Optimization:
# Use CPU offloading for large models
python scripts/cli.py train --task llm \
--cpu-offload --batch-size 8
# Reduce precision for embeddings
python scripts/cli.py train --task llm \
--embedding-precision float16
Test Real Dataset Usage:
# Comprehensive dataset validation
python test_real_datasets.py
# Expected output: "📊 TEST RESULTS: 4/4 tests passed"
# Training pipeline validation
python test_training_pipeline.py
# Expected output: "✅ ALL TRAINING PIPELINE TESTS PASSED!"
# Verify dataset composition
python scripts/cli.py info --datasets
Model Architecture Validation:
# Check model parameter count
python scripts/cli.py info --model-path ./models/llm_final.pt
# Validate gradient flow
python scripts/cli.py train --task vision --epochs 1 --debug-gradients
# Test forward pass
python scripts/cli.py inference --model-path ./models/robotics_final.pt --test-forward
Check System Requirements:
# Comprehensive system check
python scripts/cli.py info --system
# Check Python environment
python scripts/cli.py info --environment
# Validate installation
python scripts/cli.py info --test-installation
Debug Training Process:
# Enable verbose logging
python scripts/cli.py train --task llm --verbose --log-level DEBUG
# Save intermediate outputs
python scripts/cli.py train --task vision \
--debug-mode --save-intermediate-outputs
# Monitor resource usage
python scripts/cli.py train --task robotics --monitor-resources
Issue: Attention Dimension Mismatch
RuntimeError: shape '[batch, seq, heads, dim]' is invalidhidden_dim not divisible by num_attention_headsIssue: Dataset Download Timeouts
--force-reloadIssue: CUDA Out of Memory
RuntimeError: CUDA out of memory--batch-size or use --gradient-accumulation-stepsIssue: Slow Training on CPU
Community Resources:
/docs folder/experiments folder/tests folderDebug Information to Include:
When reporting issues, please include:
# System information
python scripts/cli.py info --system --gpu --environment
# Error logs with full traceback
python scripts/cli.py train --task <task> --verbose 2>&1 | tee debug.log
# Model configuration
cat your_config.json
# Dataset validation results
python test_real_datasets.py
Start Training Immediately:
# Quick LLM training (15 epochs, real programming datasets)
python scripts/cli.py train --task llm --epochs 15
# Quick Vision training (20 epochs, real computer vision datasets)
python scripts/cli.py train --task vision --epochs 20
# Quick Robotics training (30 epochs, real sensor data)
python scripts/cli.py train --task robotics --epochs 30
High-Performance LLM Training:
python scripts/cli.py train --task llm \
--liquid-units 512 --spiking-units 256 \
--num-layers 12 --hidden-dim 768 \
--num-attention-heads 12 --spike-threshold 1.1 \
--beta 0.97 --learning-rate 2e-4 \
--batch-size 16 --epochs 50 \
--sequence-length 128 --mixed-precision \
--weight-decay 0.01 --gradient-clip 1.0 \
--save-config production_llm.json \
--output-dir ./production_models/llm
Optimized Vision Training:
python scripts/cli.py train --task vision \
--liquid-units 256 --spiking-units 128 \
--num-layers 8 --hidden-dim 512 \
--conv-channels "64,128,256,512" \
--conv-kernel-sizes "3,3,3,3" \
--conv-strides "1,2,2,2" \
--batch-size 64 --learning-rate 1e-3 \
--epochs 40 --dropout 0.15 \
--save-config production_vision.json \
--output-dir ./production_models/vision
Robotics Control Training:
python scripts/cli.py train --task robotics \
--liquid-units 128 --spiking-units 64 \
--num-layers 6 --hidden-dim 256 \
--sequence-length 100 --batch-size 16 \
--learning-rate 5e-4 --epochs 50 \
--spike-threshold 1.0 --beta 0.95 \
--save-config production_robotics.json \
--output-dir ./production_models/robotics
Save and Reuse Configurations:
# Save configuration during training
python scripts/cli.py train --task llm --save-config my_llm_setup.json
# Load and modify existing configuration
python scripts/cli.py train --load-config my_llm_setup.json \
--epochs 100 --learning-rate 1e-4
# Create configuration file without training
python scripts/cli.py config --task vision \
--save-config vision_baseline.json \
--liquid-units 256 --batch-size 128
# Train with pre-configured settings
python scripts/cli.py train --load-config vision_baseline.json
Model Inference and Testing:
# Basic model inference (generates sample outputs)
python scripts/cli.py inference --model-path ./models/llm_final.pt
# Inference with custom input
python scripts/cli.py inference \
--model-path ./models/vision_final.pt \
--input-file test_images.npy
# Batch inference for evaluation
python scripts/cli.py inference \
--model-path ./models/robotics_final.pt \
--batch-size 32 --verbose
Performance Benchmarking:
# Basic performance benchmark
python scripts/cli.py benchmark --model-path ./models/llm_final.pt
# Comprehensive benchmarking with detailed metrics
python scripts/cli.py benchmark \
--model-path ./models/vision_final.pt \
--iterations 1000 --batch-size 64 \
--output-file vision_benchmark_results.json
# Compare multiple models
python scripts/cli.py benchmark \
--model-path ./models/robotics_v1.pt \
--model-path ./models/robotics_v2.pt \
--compare-models
Model Export for Deployment:
# Export to ONNX for cross-platform deployment
python scripts/cli.py export \
--model-path ./models/vision_final.pt \
--output-path ./exports/vision_model.onnx \
--format onnx
# Export to TorchScript for PyTorch deployment
python scripts/cli.py export \
--model-path ./models/llm_final.pt \
--output-path ./exports/llm_model.pt \
--format torchscript
# Export with optimization
python scripts/cli.py export \
--model-path ./models/robotics_final.pt \
--output-path ./exports/robotics_optimized.onnx \
--format onnx --optimize
Hyperparameter Search:
#!/bin/bash
# Automated hyperparameter search script
learning_rates=(1e-4 2e-4 3e-4 5e-4)
batch_sizes=(16 32 64)
for lr in "${learning_rates[@]}"; do
for bs in "${batch_sizes[@]}"; do
echo "Training with lr=$lr, batch_size=$bs"
python scripts/cli.py train --task llm \
--learning-rate $lr --batch-size $bs \
--epochs 20 --save-config "config_lr${lr}_bs${bs}.json" \
--output-dir "experiments/lr${lr}_bs${bs}"
done
done
Resume Training from Checkpoints:
# Resume interrupted training
python scripts/cli.py train --task vision \
--resume ./models/vision_epoch_15.pt \
--epochs 30 # Will continue from epoch 15 to 30
# Fine-tune pre-trained model
python scripts/cli.py train --task llm \
--resume ./models/llm_base.pt \
--learning-rate 1e-5 --epochs 10 # Lower LR for fine-tuning
Training Diagnostics:
# Training with verbose output and monitoring
python scripts/cli.py train --task robotics \
--epochs 50 --verbose \
--save-interval 5 # Save checkpoint every 5 epochs
--log-interval 100 # Log every 100 batches
# Check model information
python scripts/cli.py info --model-path ./models/llm_final.pt
# Monitor training status
python scripts/cli.py status --output-dir ./models/current_training
System Information:
# Check system compatibility
python scripts/cli.py info --system
# Check GPU availability and memory
python scripts/cli.py info --gpu
# Test installation
python scripts/cli.py info --test-installation
Verify Real Datasets Are Being Used:
# Test dataset integrity (verifies no mock/synthetic data)
python test_real_datasets.py
# Validate complete training pipeline with real data
python test_training_pipeline.py
# Check dataset statistics
python scripts/cli.py info --datasets
If using this code for research, please cite:
@software{hybrid_liquid_spiking_2024,
title={Hybrid Liquid-Spiking Neural Network System},
author={Your Name},
year={2024},
url={https://github.com/yourusername/ssn-cfc}
}
git checkout -b feature-name# Install development dependencies
pip install -e .
pip install pytest black flake8 mypy
# Run tests
pytest tests/
# Format code
black src/ tests/ scripts/
# Type checking
mypy src/
MIT License - See LICENSE file for details.
/docs folder and this README/experiments folder/tests folder for validation✅ Completed Features:
🔄 In Progress:
📋 Planned Features:
Technical Milestones:
Performance Highlights:
Built with ❤️ for the future of efficient, biological AI
This project represents a significant advancement in neural network efficiency and capability, combining the best aspects of biological neural computation with modern machine learning techniques. The hybrid approach opens new possibilities for energy-efficient AI deployment across diverse applications from edge devices to large-scale systems.
The implementation prioritizes real-world applicability with comprehensive real datasets, avoiding shortcuts or mock data that could compromise model performance in production environments. Every component has been designed for both research exploration and practical deployment.
5 commits
Python
99.5%