pub struct AdaptationNetwork<T: Float + Debug + ScalarOperand + Send + Sync + 'static> { /* private fields */ }Expand description
Task adaptation network
Implementations§
Source§impl<T: Float + Debug + ScalarOperand + Send + Sync + 'static> AdaptationNetwork<T>
impl<T: Float + Debug + ScalarOperand + Send + Sync + 'static> AdaptationNetwork<T>
pub fn new(model_dimension: usize, hidden_dimension: usize) -> Result<Self>
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Encode a task descriptor into a context embedding.
The raw descriptor is three scalars (difficulty, complexity,
data_characteristics). They are lifted to model_dimension features by
a fixed random-Fourier-style basis: feature k is
cos(2π·(k+1)·d_{k mod 3} / 3 + φ_k) with a deterministic per-index
phase, so distinct descriptors map to distinct, bounded, non-collinear
embeddings. Previously this ignored the task entirely and fed
Array2::ones, which made every task produce the same context.
Total learnable parameters across the three sub-networks.
pub fn encode_task_context(&mut self, task: &TaskBatch<T>) -> Result<Array2<T>>
pub fn predict_parameters(&mut self, context: &Array2<T>) -> Result<Vec<T>>
pub fn generate_parameter_update( &mut self, transformer_output: &Array2<T>, current_parameters: &Array1<T>, ) -> Result<Array1<T>>
Auto Trait Implementations§
impl<T> Freeze for AdaptationNetwork<T>where
FeedForwardNetwork<T>: Freeze,
impl<T> RefUnwindSafe for AdaptationNetwork<T>where
FeedForwardNetwork<T>: RefUnwindSafe,
impl<T> Send for AdaptationNetwork<T>where
FeedForwardNetwork<T>: Send,
impl<T> Sync for AdaptationNetwork<T>where
FeedForwardNetwork<T>: Sync,
impl<T> Unpin for AdaptationNetwork<T>where
FeedForwardNetwork<T>: Unpin,
impl<T> UnsafeUnpin for AdaptationNetwork<T>where
FeedForwardNetwork<T>: UnsafeUnpin,
impl<T> UnwindSafe for AdaptationNetwork<T>where
FeedForwardNetwork<T>: 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
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
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 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.