concision_core/traits/
predict.rs

1/*
2    Appellation: predict <module>
3    Contrib: @FL03
4*/
5
6/// This trait defines the forward pass of the network
7
8pub trait Forward<Rhs> {
9    type Output;
10
11    fn forward(&self, input: &Rhs) -> crate::Result<Self::Output>;
12}
13
14/// This trait defines the prediction of the network
15pub trait Predict<Rhs> {
16    type Confidence;
17    type Output;
18
19    fn predict(&self, input: &Rhs) -> crate::Result<Self::Output>;
20
21    fn predict_with_confidence(
22        &self,
23        input: &Rhs,
24    ) -> crate::Result<(Self::Output, Self::Confidence)>;
25}