pub struct MAMLModel { /* private fields */ }Expand description
Concrete implementations of meta-learning models would go here For brevity, I’ll include basic stubs
Implementations§
Source§impl MAMLModel
impl MAMLModel
pub fn new(config: &MetaLearningConfig) -> Result<Self, TrustformersError>
Trait Implementations§
Source§impl MetaLearningModel for MAMLModel
impl MetaLearningModel for MAMLModel
fn forward(&mut self, _examples: &ExampleSet) -> Result<f64, TrustformersError>
fn compute_accuracy( &self, _examples: &ExampleSet, ) -> Result<f64, TrustformersError>
fn compute_gradients( &self, _loss: f64, ) -> Result<ModelGradients, TrustformersError>
fn apply_gradients( &mut self, _gradients: &ModelGradients, _lr: f64, ) -> Result<(), TrustformersError>
fn get_parameters(&self) -> Result<ModelParameters, TrustformersError>
fn set_parameters( &mut self, _params: ModelParameters, ) -> Result<(), TrustformersError>
fn embed(&self, example: &Example) -> Result<Tensor, TrustformersError>
fn compute_second_order_gradients( &self, _initial_params: &ModelParameters, _loss: f64, ) -> Result<ModelGradients, TrustformersError>
fn compute_first_order_gradients( &self, _loss: f64, ) -> Result<ModelGradients, TrustformersError>
fn compute_relation( &self, _emb1: &Tensor, _emb2: &Tensor, ) -> Result<f64, TrustformersError>
fn write_to_memory( &mut self, _example: &Example, ) -> Result<(), TrustformersError>
fn read_from_memory( &self, _example: &Example, ) -> Result<MemoryOutput, TrustformersError>
fn predict_from_memory( &self, _memory_output: &MemoryOutput, ) -> Result<MemoryPrediction, TrustformersError>
fn clear_memory(&mut self) -> Result<(), TrustformersError>
fn get_learning_rates(&self) -> Result<Vec<f64>, TrustformersError>
fn apply_gradients_with_lr( &mut self, _gradients: &ModelGradients, _learning_rates: &[f64], ) -> Result<(), TrustformersError>
fn compute_lr_gradients( &self, _loss: f64, ) -> Result<Vec<f64>, TrustformersError>
fn get_meta_learner_state(&self) -> Result<MetaLearnerState, TrustformersError>
fn apply_learned_algorithm( &self, _support_set: &ExampleSet, _state: &MetaLearnerState, ) -> Result<ModelParameters, TrustformersError>
fn evaluate_with_params( &self, _examples: &ExampleSet, _params: &ModelParameters, ) -> Result<f64, TrustformersError>
fn compute_accuracy_with_params( &self, _examples: &ExampleSet, _params: &ModelParameters, ) -> Result<f64, TrustformersError>
fn compute_meta_learner_gradients( &self, _loss: f64, ) -> Result<ModelGradients, TrustformersError>
fn get_lstm_state(&self) -> Result<LSTMState, TrustformersError>
fn lstm_update( &self, _gradients: &ModelGradients, _state: &LSTMState, _step: usize, ) -> Result<(ModelUpdates, LSTMState), TrustformersError>
fn apply_lstm_updates( &mut self, _updates: &ModelUpdates, ) -> Result<(), TrustformersError>
fn compute_lstm_gradients( &self, _loss: f64, ) -> Result<ModelGradients, TrustformersError>
Auto Trait Implementations§
impl Freeze for MAMLModel
impl RefUnwindSafe for MAMLModel
impl Send for MAMLModel
impl Sync for MAMLModel
impl Unpin for MAMLModel
impl UnsafeUnpin for MAMLModel
impl UnwindSafe for MAMLModel
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