pub struct TitansBlock { /* private fields */ }Expand description
Single Titans decoder block with Neural Long-Term Memory
Implementations§
Source§impl TitansBlock
impl TitansBlock
pub fn new( embed_dim: usize, num_heads: usize, ff_dim: usize, memory_size: usize, rng: &mut StdRng, ) -> Self
pub fn forward(&mut self, sequence: &[Vec<f32>]) -> Vec<f32>
Sourcepub fn get_surprise(&self) -> f32
pub fn get_surprise(&self) -> f32
Get current surprise level (for anomaly detection)
Sourcepub fn reset_memory(&mut self)
pub fn reset_memory(&mut self)
Reset memory state
Trait Implementations§
Source§impl Clone for TitansBlock
impl Clone for TitansBlock
Source§fn clone(&self) -> TitansBlock
fn clone(&self) -> TitansBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TitansBlock
impl Debug for TitansBlock
Source§impl<'de> Deserialize<'de> for TitansBlock
impl<'de> Deserialize<'de> for TitansBlock
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
Auto Trait Implementations§
impl Freeze for TitansBlock
impl RefUnwindSafe for TitansBlock
impl Send for TitansBlock
impl Sync for TitansBlock
impl Unpin for TitansBlock
impl UnsafeUnpin for TitansBlock
impl UnwindSafe for TitansBlock
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