Skip to content

Latest commit

 

History

History
94 lines (72 loc) · 2.38 KB

specification.md

File metadata and controls

94 lines (72 loc) · 2.38 KB

Unified AI (UAI) Specification v1.0

Core Definition

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.

Key Components

1. Neural Network Architecture

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.

2. Core Operations

Layer Management

  • Dynamic layer addition with input/output size specification
  • Automatic layer size validation
  • Xavier weight initialization

Training Pipeline

  • Forward propagation with layer caching
  • Backward propagation with error computation
  • Gradient-based weight updates

Optimization Methods

  • Sthocastic Gradient Descend
  • Adam with momentum (optional)

3. Supported Features

Activation Functions

  • Tanh
  • Sigmoid
  • ReLU
  • SELU
  • Softmax

Loss Functions

  • Mean Squared Error
  • Cross-Entropy

Model Persistence

  • Save to .uai format
  • Load from .uai files
  • Metadata management

Implementation Requirements

Browser Compatibility

  • Zero external dependencies
  • Pure JavaScript implementation
  • Web-first architecture

Memory Management

  • Efficient matrix operations
  • Automatic cleanup of optimization states
  • Browser-friendly resource usage

Error Handling

  • Layer size validation
  • Numerical stability checks
  • Graceful fallbacks

File Format (.uai)

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
}

Version Information

  • 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.