pub struct NtmConfig<A: Float + ScalarOperand + Debug> {
pub memory_slots: usize,
pub memory_width: usize,
pub learning_rate: A,
pub read_sharpness: A,
pub erase_gate: A,
pub addressing_mode: AddressingMode,
pub memory_weight: A,
pub gradient_weight: A,
pub seed: u64,
}Expand description
Configuration for an NtmOptimizer.
The defaults mirror the values recommended in the project specification:
32 slots × 16-wide memory, learning rate 0.01, hybrid addressing,
read_sharpness = 1, erase_gate = 0.5, and 0.7 / 0.3 weighting
between the raw gradient and the memory read vector.
Fields§
§memory_slots: usizeNumber of memory slots N (rows of the memory matrix).
memory_width: usizeWidth of each memory slot W (columns of the memory matrix).
learning_rate: ABase learning rate applied to the final update.
read_sharpness: ARead-attention sharpness factor β (the NTM paper’s β).
erase_gate: AErase gate (a scalar in [0, 1]) controlling how aggressively the
write head zeroes a memory cell before adding the new content.
addressing_mode: AddressingModeAddressing mode for the read head.
memory_weight: AWeight assigned to the (tiled) read vector when forming the update.
gradient_weight: AWeight assigned to the raw gradient when forming the update.
seed: u64RNG seed used for any stochastic initialisation. Memory itself is initialised to zero; the seed is kept so subclasses/tests can rely on deterministic behaviour.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for NtmConfig<A>where
A: Freeze,
impl<A> RefUnwindSafe for NtmConfig<A>where
A: RefUnwindSafe,
impl<A> Send for NtmConfig<A>where
A: Send,
impl<A> Sync for NtmConfig<A>where
A: Sync,
impl<A> Unpin for NtmConfig<A>where
A: Unpin,
impl<A> UnsafeUnpin for NtmConfig<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for NtmConfig<A>where
A: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.