pub struct MuLawCodec { /* private fields */ }Expand description
μ-law companding codec
Implementations§
Source§impl MuLawCodec
impl MuLawCodec
Sourcepub fn dequantize(&self, level: i32) -> f32
pub fn dequantize(&self, level: i32) -> f32
Dequantize from integer level
Trait Implementations§
Source§impl Clone for MuLawCodec
impl Clone for MuLawCodec
Source§fn clone(&self) -> MuLawCodec
fn clone(&self) -> MuLawCodec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MuLawCodec
impl Debug for MuLawCodec
Source§impl SignalTokenizer for MuLawCodec
impl SignalTokenizer for MuLawCodec
Source§fn encode(&self, signal: &Array1<f32>) -> TokenizerResult<Array1<f32>>
fn encode(&self, signal: &Array1<f32>) -> TokenizerResult<Array1<f32>>
Encode a continuous signal into tokens/embeddings
Source§fn decode(&self, tokens: &Array1<f32>) -> TokenizerResult<Array1<f32>>
fn decode(&self, tokens: &Array1<f32>) -> TokenizerResult<Array1<f32>>
Decode tokens/embeddings back to continuous signal
Source§fn vocab_size(&self) -> usize
fn vocab_size(&self) -> usize
Get the vocabulary size (for discrete tokenizers, 0 for continuous)
Source§impl TokenizerIO for MuLawCodec
impl TokenizerIO for MuLawCodec
Source§fn save_binary<P: AsRef<Path>>(&self, path: P) -> TokenizerResult<()>
fn save_binary<P: AsRef<Path>>(&self, path: P) -> TokenizerResult<()>
Save to binary file (using bincode)
Source§fn load_binary<P: AsRef<Path>>(path: P) -> TokenizerResult<Self>
fn load_binary<P: AsRef<Path>>(path: P) -> TokenizerResult<Self>
Load from binary file (using bincode)
Auto Trait Implementations§
impl Freeze for MuLawCodec
impl RefUnwindSafe for MuLawCodec
impl Send for MuLawCodec
impl Sync for MuLawCodec
impl Unpin for MuLawCodec
impl UnwindSafe for MuLawCodec
Blanket Implementations§
Source§impl<T> BatchTokenizer for Twhere
T: SignalTokenizer,
impl<T> BatchTokenizer for Twhere
T: SignalTokenizer,
Source§fn encode_batch(&self, signals: &Array2<f32>) -> TokenizerResult<Array2<f32>>
fn encode_batch(&self, signals: &Array2<f32>) -> TokenizerResult<Array2<f32>>
Encode multiple signals in batch Read more
Source§fn decode_batch(&self, tokens: &Array2<f32>) -> TokenizerResult<Array2<f32>>
fn decode_batch(&self, tokens: &Array2<f32>) -> TokenizerResult<Array2<f32>>
Decode multiple token sequences in batch Read more
Source§fn encode_batch_padded_to(
&self,
signals: &[Array1<f32>],
target_len: usize,
) -> TokenizerResult<Array2<f32>>
fn encode_batch_padded_to( &self, signals: &[Array1<f32>], target_len: usize, ) -> TokenizerResult<Array2<f32>>
Encode batch with padding to handle variable length signals Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more