Code Examples
Explore practical examples demonstrating LOOM's capabilities across different use cases.
Getting Started Examples
Simple Dense Network
Basic feedforward neural network with Dense layers for classification tasks.
View on GitHub →Training Loop
Complete example showing training with gradient descent, loss tracking, and validation.
View on GitHub →Model Serialization
Save and load models as JSON for deployment across platforms.
View Documentation →Layer Type Examples
Multi-Head Attention
Transformer-style attention mechanism with GPU-accelerated matrix operations.
View on GitHub →LSTM Example
Long Short-Term Memory network with gated cells for long-range dependencies.
View on GitHub →Advanced Examples
MoE Proof Demo
Mathematical proof that Grid Softmax equals Mixture of Experts with 97.1% loss reduction.
View on GitHub →All Layers Validation
End-to-end validation test with all 5 layer types and 10 softmax variants.
View on GitHub →Multi-Language Examples
JavaScript/TypeScript WASM
Browser-based neural network training and inference with WebAssembly.
View on GitHub →Interactive Demo
The LOOM repository includes an interactive demo application called "fabric" that lets you explore all features:
cd loom/fabric
go build
./fabric
Choose from options including Dense, Conv2D, Attention, RNN, LSTM demos, and comprehensive CPU vs GPU benchmarks.
Repository Structure
Find examples in these directories:
fabric/demos/- Individual layer demonstrationsexamples/- Validation tests and benchmarkspython/examples/- Python-specific examplestypescript/examples/- TypeScript/WASM examplescsharp/examples/- C#/.NET exampleswasm/- WebAssembly deployment examplescabi/- C Foreign Function Interface examples