Predictor

Trait Predictor 

Source
pub trait Predictor: Send + Sync {
    // Required methods
    fn predict(&self, input: &[f32]) -> Result<Vec<usize>>;
    fn calibrate(
        &mut self,
        samples: &[Vec<f32>],
        activations: &[Vec<f32>],
    ) -> Result<()>;
    fn stats(&self) -> PredictorStats;
}
Expand description

Trait for activation predictors.

Required Methods§

Source

fn predict(&self, input: &[f32]) -> Result<Vec<usize>>

Predict active neurons for the given input.

Returns a vector of neuron indices that are predicted to be active.

Source

fn calibrate( &mut self, samples: &[Vec<f32>], activations: &[Vec<f32>], ) -> Result<()>

Calibrate the predictor using sample data.

§Arguments
  • samples - Input samples
  • activations - Corresponding activation patterns
Source

fn stats(&self) -> PredictorStats

Get predictor statistics.

Implementors§