pub struct ContinuousTokenizer { /* private fields */ }Expand description
Continuous tokenizer that projects signals to embedding space
Implementations§
Source§impl ContinuousTokenizer
impl ContinuousTokenizer
Sourcepub fn set_encoder(&mut self, weights: Array2<f32>) -> TokenizerResult<()>
pub fn set_encoder(&mut self, weights: Array2<f32>) -> TokenizerResult<()>
Set encoder weights
Sourcepub fn set_decoder(&mut self, weights: Array2<f32>) -> TokenizerResult<()>
pub fn set_decoder(&mut self, weights: Array2<f32>) -> TokenizerResult<()>
Set decoder weights
Trait Implementations§
Source§impl Clone for ContinuousTokenizer
impl Clone for ContinuousTokenizer
Source§fn clone(&self) -> ContinuousTokenizer
fn clone(&self) -> ContinuousTokenizer
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 ContinuousTokenizer
impl Debug for ContinuousTokenizer
Source§impl SignalTokenizer for ContinuousTokenizer
impl SignalTokenizer for ContinuousTokenizer
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 ContinuousTokenizer
impl TokenizerIO for ContinuousTokenizer
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 ContinuousTokenizer
impl RefUnwindSafe for ContinuousTokenizer
impl Send for ContinuousTokenizer
impl Sync for ContinuousTokenizer
impl Unpin for ContinuousTokenizer
impl UnwindSafe for ContinuousTokenizer
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