pub struct HrmCore {
pub t_inner: usize,
pub n_cycles: usize,
/* private fields */
}Expand description
The two-timescale core. L iterates fast against the injected input; H steps back once per cycle to
integrate L’s state. Output is zH + reps, a residual refinement of the embeddings.
Fields§
§t_inner: usize§n_cycles: usizeImplementations§
Source§impl HrmCore
impl HrmCore
pub fn new( h: usize, layers_l: usize, layers_h: usize, t_inner: usize, n_cycles: usize, heads: usize, vb: VarBuilder<'_>, ) -> Result<Self>
Sourcepub fn forward(
&self,
reps: &Tensor,
mask: Option<&Tensor>,
grad_last_step: bool,
) -> Result<Tensor>
pub fn forward( &self, reps: &Tensor, mask: Option<&Tensor>, grad_last_step: bool, ) -> Result<Tensor>
Refine reps [B,T,h] → [B,T,h]. The N_cycles of refinement run detached (the reference’s
no_grad), and only the final L+H step carries gradient — the one-step gradient approximation that
makes recurrent depth trainable at this size.
Auto Trait Implementations§
impl !RefUnwindSafe for HrmCore
impl !UnwindSafe for HrmCore
impl Freeze for HrmCore
impl Send for HrmCore
impl Sync for HrmCore
impl Unpin for HrmCore
impl UnsafeUnpin for HrmCore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreCreates a shared type from an unshared type.