Expand description
Real-Time Audit Log & Explainability for APR Format Models
§Toyota Way: 現地現物 (Genchi Genbutsu)
Every decision is traceable to ground truth. All predictions can be explained.
§Architecture
- DecisionPath: Model-specific explanation of how a decision was made
- DecisionTrace: Complete record of a single prediction
- Explainable: Trait for models that can explain their predictions
- TraceCollector: Strategy for collecting decision traces
§Collectors
- RingCollector: Stack-allocated, <100ns, for games/drones
- StreamCollector: Write-through, <1µs, for persistent logging
- HashChainCollector: SHA-256 chain, <10µs, for safety-critical
§Example
ⓘ
use entrenar::monitor::inference::{
InferenceMonitor, RingCollector, LinearPath,
};
let model = LinearRegressor::load("model.apr")?;
let collector = RingCollector::<LinearPath, 64>::new();
let mut monitor = InferenceMonitor::new(model, collector);
let prediction = monitor.predict(&input);
let traces = monitor.traces();Re-exports§
pub use collector::ChainEntry;pub use collector::ChainVerification;pub use collector::HashChainCollector;pub use collector::RingCollector;pub use collector::StreamCollector;pub use collector::StreamFormat;pub use collector::TraceCollector;pub use counterfactual::Counterfactual;pub use counterfactual::FeatureChange;pub use provenance::Anomaly;pub use provenance::AttackPath;pub use provenance::CausalRelation;pub use provenance::IncidentReconstructor;pub use provenance::NodeId;pub use provenance::ProvenanceEdge;pub use provenance::ProvenanceGraph;pub use provenance::ProvenanceNode;pub use safety_andon::EmergencyCondition;pub use safety_andon::SafetyAndon;pub use safety_andon::SafetyIntegrityLevel;pub use serialization::PathType;pub use serialization::SerializationError;pub use serialization::TraceFormat;pub use serialization::TraceSerializer;pub use serialization::APRT_MAGIC;pub use serialization::APRT_VERSION;pub use trace::DecisionTrace;
Modules§
- collector
- Trace Collectors (ENT-105, ENT-106, ENT-107)
- counterfactual
- Counterfactual Explanations (ENT-104)
- path
- Decision Path Types (ENT-102)
- provenance
- Provenance Graph for Incident Reconstruction (ENT-111)
- safety_
andon - Safety Andon for Inference (ENT-110)
- serialization
- Trace Serialization (ENT-108)
- trace
- Decision Trace (ENT-104)
Structs§
- Forest
Path - Decision path for ensemble models (Random Forest, Gradient Boosting)
- Inference
Monitor - High-level inference monitor
- KNNPath
- Decision path for KNN
- Leaf
Info - Information about the leaf node reached
- Linear
Path - Decision path for linear regression/logistic regression
- Neural
Path - Decision path for neural networks (gradient-based)
- Tree
Path - Decision path for tree-based models
- Tree
Split - A single split decision in a tree
Enums§
- Path
Error - Error type for path operations
Traits§
- Decision
Path - Common interface for all decision paths
- Explainable
- Trait for models that can explain their predictions
Functions§
- fnv1a_
hash - FNV-1a hash for input features
- hash_
features - Hash a slice of f32 values
- monotonic_
ns - Monotonic nanosecond timestamp