Expand description
Tropical-Dual-Clifford fusion system for optimal LLM evaluation
This crate combines three exotic number systems:
- Tropical algebra: Converts expensive softmax operations to max operations
- Dual numbers: Provides automatic differentiation without computational graphs
- Clifford algebra: Handles geometric relationships and rotations
Together, these systems create a powerful framework for efficient neural network evaluation and optimization.
§Key Types
The main type is TropicalDualClifford, which fuses all three algebras:
ⓘ
use amari_fusion::TropicalDualClifford;
// Create TDC values
let tdc1 = TropicalDualClifford::<f64, 8>::random_with_scale(1.0);
let tdc2 = TropicalDualClifford::<f64, 8>::random_with_scale(1.0);
// Geometric operations
let product = &tdc1 * &tdc2; // Tropical-modified geometric product
let rotated = tdc1.rotate_by(&tdc2); // Rotor-based rotation
// Access components
let tropical_val = tdc1.tropical_value();
let gradient = tdc1.gradient();§Vector Symbolic Architectures
TropicalDualClifford has built-in binding operations for holographic memory:
ⓘ
use amari_fusion::TropicalDualClifford;
let key = TropicalDualClifford::<f64, 8>::random_with_scale(1.0);
let value = TropicalDualClifford::<f64, 8>::random_with_scale(1.0);
// Binding operations (inherent methods)
let bound = key.bind(&value); // Create association
let retrieved = key.unbind(&bound); // Retrieve value
let superposed = key.bundle(&value, 1.0); // Superposition
let sim = key.similarity(&value); // Cosine similarity§Holographic Memory (v0.12.3+)
For dedicated Vector Symbolic Architectures (VSA) and holographic reduced
representations with multiple algebra options, use the standalone
amari-holographic crate:
ⓘ
use amari_holographic::{HolographicMemory, ProductCliffordAlgebra, BindingAlgebra, AlgebraConfig};
type ProductCl3x32 = ProductCliffordAlgebra<32>;
// Create memory with 256-dimensional algebra
let mut memory = HolographicMemory::<ProductCl3x32>::new(AlgebraConfig::default());
// Store and retrieve
let key = ProductCl3x32::random_versor(2);
let value = ProductCl3x32::random_versor(2);
memory.store(&key, &value);
let result = memory.retrieve(&key);When the holographic feature is enabled, types are re-exported here for
backward compatibility.
§Feature Flags
| Feature | Description |
|---|---|
std | Standard library support (default) |
high-precision | Enable 128-bit and arbitrary precision floats |
holographic | Re-export amari-holographic types |
parallel | Enable parallel operations via rayon |
Re-exports§
pub use types::EvaluationError;pub use types::EvaluationResult;pub use types::TropicalDualClifford;
Modules§
- attention
- Attention mechanisms using Tropical-Dual-Clifford algebra
- evaluation
- LLM evaluation metrics using Tropical-Dual-Clifford algebra
- optimizer
- Optimization using combined tropical-dual-clifford algebra
- types
- Tropical-Dual-Clifford Fusion Types - The Heart of Amari
- verified
- Verified fusion operations with phantom types for compile-time safety
- verified_
contracts - Formal verification contracts for tropical-dual-clifford fusion algebra
Traits§
- Precision
Float - Unified trait for floating-point arithmetic in scientific computing
Type Aliases§
- Extended
Dual - Extended-precision dual number (uses extended precision float from amari-core)
- Extended
Float - Extended
Multi Dual - Extended-precision multi-dual number (uses extended precision float from amari-core)
- Extended
Tropical - Extended-precision tropical number (uses extended precision float from amari-core)
- High
Precision Float - Standard
Dual - Standard-precision dual number (f64)
- Standard
Float - Type alias for standard precision calculations
- Standard
Multi Dual - Standard-precision multi-dual number (f64)
- Standard
Tropical - Standard-precision tropical number (f64)