InfererExt

Trait InfererExt 

Source
pub trait InfererExt: Inferer + Sized {
    // Provided methods
    fn with_default_epsilon(self, key: &str) -> Result<EpsilonInjector<Self>> { ... }
    fn with_epsilon<G: NoiseGenerator>(
        self,
        generator: G,
        key: &str,
    ) -> Result<EpsilonInjector<Self, G>> { ... }
    fn into_batched(self) -> Batched<Self> { ... }
    fn infer(
        &mut self,
        observations: HashMap<u64, State<'_>>,
    ) -> Result<HashMap<u64, Response<'_>>, Error> { ... }
    fn infer_batch<'this>(
        &'this self,
        batch: HashMap<u64, State<'_>>,
    ) -> Result<HashMap<u64, Response<'this>>, Error> { ... }
    fn infer_single<'this>(
        &'this self,
        input: State<'_>,
    ) -> Result<Response<'this>, Error> { ... }
}
Expand description

Extension trait for Inferer.

Provided Methods§

Source

fn with_default_epsilon(self, key: &str) -> Result<EpsilonInjector<Self>>

Add an epsilon injector using the default noise kind.

Source

fn with_epsilon<G: NoiseGenerator>( self, generator: G, key: &str, ) -> Result<EpsilonInjector<Self, G>>

Add an epsilon injector with a specific noise generator.

Source

fn into_batched(self) -> Batched<Self>

Wrap in a batching interface.

Source

fn infer( &mut self, observations: HashMap<u64, State<'_>>, ) -> Result<HashMap<u64, Response<'_>>, Error>

👎Deprecated since 0.3.0: Please use the more explicit ‘infer_batch’ instead.

Execute the model on the provided batch of elements.

Source

fn infer_batch<'this>( &'this self, batch: HashMap<u64, State<'_>>, ) -> Result<HashMap<u64, Response<'this>>, Error>

Execute the model on the provided pre-batched data.

Source

fn infer_single<'this>( &'this self, input: State<'_>, ) -> Result<Response<'this>, Error>

Execute the model on the provided pre-batched data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> InfererExt for T
where T: Inferer + Sized,