pub struct RetNetLayer { /* private fields */ }Expand description
RetNet Layer
Combines Multi-Scale Retention and FFN with residual connections
Implementations§
Source§impl RetNetLayer
impl RetNetLayer
Sourcepub fn new(config: RetNetConfig) -> CoreResult<Self>
pub fn new(config: RetNetConfig) -> CoreResult<Self>
Create a new RetNet layer
Sourcepub fn step(
&self,
input: &Array1<f32>,
state: &mut Array3<f32>,
) -> CoreResult<Array1<f32>>
pub fn step( &self, input: &Array1<f32>, state: &mut Array3<f32>, ) -> CoreResult<Array1<f32>>
Forward step with residual connections
Sourcepub fn forward_sequence(&self, input: &Array2<f32>) -> CoreResult<Array2<f32>>
pub fn forward_sequence(&self, input: &Array2<f32>) -> CoreResult<Array2<f32>>
Forward sequence
Sourcepub fn reset_state(&self) -> Array3<f32>
pub fn reset_state(&self) -> Array3<f32>
Reset state
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RetNetLayer
impl RefUnwindSafe for RetNetLayer
impl Send for RetNetLayer
impl Sync for RetNetLayer
impl Unpin for RetNetLayer
impl UnwindSafe for RetNetLayer
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