pub struct CategoricalEncoder<E, V, M>where
V: Clone + Eq + Hash,
M: Number<V>,{ /* private fields */ }
Expand description
An encoder wrapper that encodes/decodes to a categorical label.
Implementations§
source§impl<D, M> CategoricalEncoder<D, D::Encoding, M>where
D: SentenceDecoder,
D::Encoding: Clone + Eq + Hash + ToOwned,
M: Number<D::Encoding>,
impl<D, M> CategoricalEncoder<D, D::Encoding, M>where D: SentenceDecoder, D::Encoding: Clone + Eq + Hash + ToOwned, M: Number<D::Encoding>,
sourcepub fn decode_without_inner<S>(
&self,
labels: &[S]
) -> Vec<Vec<EncodingProb<D::Encoding>>>where
S: AsRef<[EncodingProb<usize>]>,
pub fn decode_without_inner<S>( &self, labels: &[S] ) -> Vec<Vec<EncodingProb<D::Encoding>>>where S: AsRef<[EncodingProb<usize>]>,
Decode without applying the inner decoder.
Trait Implementations§
source§impl<'de, E, V, M> Deserialize<'de> for CategoricalEncoder<E, V, M>where
V: Clone + Eq + Hash,
M: Number<V> + Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, E, V, M> Deserialize<'de> for CategoricalEncoder<E, V, M>where V: Clone + Eq + Hash, M: Number<V> + Deserialize<'de>, E: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<D, M> SentenceDecoder for CategoricalEncoder<D, D::Encoding, M>where
D: SentenceDecoder,
D::Encoding: Clone + Eq + Hash,
M: Number<D::Encoding>,
impl<D, M> SentenceDecoder for CategoricalEncoder<D, D::Encoding, M>where D: SentenceDecoder, D::Encoding: Clone + Eq + Hash, M: Number<D::Encoding>,
source§impl<E, M> SentenceEncoder for CategoricalEncoder<E, E::Encoding, M>where
E: SentenceEncoder,
E::Encoding: Clone + Eq + Hash,
M: Number<E::Encoding>,
impl<E, M> SentenceEncoder for CategoricalEncoder<E, E::Encoding, M>where E: SentenceEncoder, E::Encoding: Clone + Eq + Hash, M: Number<E::Encoding>,
Auto Trait Implementations§
impl<E, V, M> RefUnwindSafe for CategoricalEncoder<E, V, M>where E: RefUnwindSafe, M: RefUnwindSafe, V: RefUnwindSafe,
impl<E, V, M> Send for CategoricalEncoder<E, V, M>where E: Send, M: Send, V: Send,
impl<E, V, M> Sync for CategoricalEncoder<E, V, M>where E: Sync, M: Sync, V: Sync,
impl<E, V, M> Unpin for CategoricalEncoder<E, V, M>where E: Unpin, M: Unpin, V: Unpin,
impl<E, V, M> UnwindSafe for CategoricalEncoder<E, V, M>where E: UnwindSafe, M: UnwindSafe, V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more