Skip to main content

Crate ternsig

Crate ternsig 

Source
Expand description

§Ternsig - TernarySignal Foundation

The foundational crate that unlocked a new way of thinking about neural learning. TernarySignals (polarity + magnitude) replace floating-point weights entirely.

§Core Components

  • TernarySignal: The fundamental unit (polarity ∈ {-1,0,+1}, magnitude ∈ 0-255)
  • TensorISA: Hot-reloadable neural network instruction set (.tisa.asm files)
  • Adaptive Learning: Mastery learning - 23ms updates, 90% accuracy threshold
  • Thermogram Integration: Persistent weight storage with temperature lifecycle

§Three-Tier Learning System

  1. Tier 1 (Priors): Offline instinct creation via mastery learning
  2. Tier 2 (Coordination): SNN + neuromodulators gate learning
  3. Tier 3 (Runtime): Continuous 23ms adaptive refinement

§Design Principles

  • No floats: All weights are TernarySignal (2 bytes each)
  • CPU-only: Integer arithmetic, no GPU required
  • Persistent: All weights use thermograms (survive crashes)
  • Hot-reloadable: .tisa.asm files define network architecture

§Example

use ternsig::{TernarySignal, TensorInterpreter, assemble};

// Load chip definition
let program = assemble(include_str!("onset.tisa.asm"))?;
let mut interpreter = TensorInterpreter::new(&program)?;

// Forward pass with ternary weights
interpreter.set_input(&input_signals);
interpreter.execute()?;
let output = interpreter.get_output();

Re-exports§

pub use tensor_isa::TensorInterpreter;
pub use tensor_isa::TensorInstruction;
pub use tensor_isa::TensorAction;
pub use tensor_isa::TensorRegister;
pub use tensor_isa::HotBuffer;
pub use tensor_isa::ColdBuffer;
pub use tensor_isa::TensorDtype;
pub use tensor_isa::TensorModifier;
pub use tensor_isa::assemble;
pub use tensor_isa::AssembledProgram;
pub use tensor_isa::AssemblerError;
pub use tensor_isa::serialize_tisa;
pub use tensor_isa::deserialize_tisa;
pub use tensor_isa::load_tisa_file;
pub use tensor_isa::save_tisa_file;
pub use tensor_isa::HotReloadManager;
pub use tensor_isa::ReloadableInterpreter;
pub use tensor_isa::ArchStats;
pub use tensor_isa::ModEvent;
pub use tensor_isa::ShapeSpec;
pub use tensor_isa::WireSpec;
pub use tensor_isa::WireType;
pub use learning::PolarityState;
pub use learning::SurpriseOptimizer;
pub use learning::SurpriseOptimizerConfig;
pub use learning::FloatingTernaryLayer;
pub use learning::OptimizerStats;
pub use thermo::TensorThermogram;
pub use thermo::WeightContent;
pub use thermo::ThermalState;
pub use thermo::TensorContent;
pub use thermo::ProgramMetaContent;
pub use thermo::LearningStateContent;

Modules§

learning
Adaptive Learning System for TernarySignal Weights
tensor_isa
Tensor ISA - Instruction Set Architecture for Neural Network Definitions
thermo
Thermogram Bridge for TensorISA

Structs§

TernarySignal
Ternary signal: polarity + magnitude

Enums§

TernsigError
Ternsig error type