carbono
is a lightweight, UAI-compatible feed-forward network example. It provides a unified interface for training, inference, and model management. On the other hand, UAI
is a specification, an effort to push interest into a common web standard for feed-forward neural networks management on browsers.
class carbono {
constructor() {
this.layers = []; // Network layers
this.weights = []; // Layer weights
this.biases = []; // Layer biases
this.details = {}; // Model metadata
}
}
layers
must contain, number of input and output nodes as reference as well as its activation function.details
might contain any useful information for the end user.
- Dynamic layer addition with input/output size specification
- Automatic layer size validation
- Xavier weight initialization
- Forward propagation with layer caching
- Backward propagation with error computation
- Gradient-based weight updates
- Sthocastic Gradient Descend
- Adam with momentum (optional)
- Tanh
- Sigmoid
- ReLU
- SELU
- Softmax
- Mean Squared Error
- Cross-Entropy
- Save to .uai format
- Load from .uai files
- Metadata management
- Zero external dependencies
- Pure JavaScript implementation
- Web-first architecture
- Efficient matrix operations
- Automatic cleanup of optimization states
- Browser-friendly resource usage
- Layer size validation
- Numerical stability checks
- Graceful fallbacks
Unified AI format is a simple JSON string with at least the following properties:
{
weights: Float32Array[][],
biases: Float32Array[],
layers: LayerConfig[],
details: ModelMetadata,
tags?: string[] // Optional for classification
}
- Specification Version: 1.0
- Implementation Status: Beta
- Last Updated: Mon 25 Nov, 2024
This specification defines the core functionality and requirements for implementing carbono's architecture and file format, focusing on simplicity, accessibility, and browser compatibility.