pub struct RetNetModel { /* private fields */ }Expand description
Multi-layer RetNet Model
Implementations§
Source§impl RetNetModel
impl RetNetModel
Sourcepub fn new(config: RetNetConfig) -> CoreResult<Self>
pub fn new(config: RetNetConfig) -> CoreResult<Self>
Create a new multi-layer RetNet model
Sourcepub fn step(
&self,
input: &Array1<f32>,
states: &mut [Array3<f32>],
) -> CoreResult<Array1<f32>>
pub fn step( &self, input: &Array1<f32>, states: &mut [Array3<f32>], ) -> CoreResult<Array1<f32>>
Single step inference
Sourcepub fn forward(&self, input: &Array2<f32>) -> CoreResult<Array2<f32>>
pub fn forward(&self, input: &Array2<f32>) -> CoreResult<Array2<f32>>
Forward pass for sequence
Sourcepub fn num_parameters(&self) -> usize
pub fn num_parameters(&self) -> usize
Get total number of parameters
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RetNetModel
impl RefUnwindSafe for RetNetModel
impl Send for RetNetModel
impl Sync for RetNetModel
impl Unpin for RetNetModel
impl UnwindSafe for RetNetModel
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
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