pub struct MetaLearner<A: Float + Send + Sync> { /* private fields */ }Expand description
Meta-learning system for streaming optimization
Implementations§
Source§impl<A: Float + Default + Clone + Sum + Send + Sync + Debug> MetaLearner<A>
impl<A: Float + Default + Clone + Sum + Send + Sync + Debug> MetaLearner<A>
Sourcepub fn new(config: &StreamingConfig) -> Result<Self, String>
pub fn new(config: &StreamingConfig) -> Result<Self, String>
Creates a new meta-learner
Sourcepub fn update_context_signals(
&mut self,
resource_state: Vec<A>,
drift_indicators: Vec<A>,
)
pub fn update_context_signals( &mut self, resource_state: Vec<A>, drift_indicators: Vec<A>, )
Supplies the resource and drift signals the meta-learner cannot observe for itself.
ML5: extract_meta_state used to fill resource_state with the
constants [0.5, 0.3] and drift_indicators with [0.1], so the
bandit’s context vector was two thirds fabricated and identical on every
call. The owning optimizer knows the real values and reports them here.
Sourcepub fn update_experience(
&mut self,
state: MetaState<A>,
action: MetaAction<A>,
reward: A,
) -> Result<(), String>
pub fn update_experience( &mut self, state: MetaState<A>, action: MetaAction<A>, reward: A, ) -> Result<(), String>
Updates the meta-learner with new experience
Sourcepub fn register_transfer_source(
&mut self,
source_id: String,
experiences: Vec<MetaExperience<A>>,
source_characteristics: Vec<A>,
) -> Result<(), String>
pub fn register_transfer_source( &mut self, source_id: String, experiences: Vec<MetaExperience<A>>, source_characteristics: Vec<A>, ) -> Result<(), String>
Registers a source domain whose experiences may be replayed into this learner when transfer learning is enabled.
Returns an error when MetaLearningConfig::enable_transfer_learning is
off, rather than accepting the source and never using it (CF1: that flag
previously had no reader at all, so transfer learning was neither on nor
off — it simply did not exist).
Sourcepub fn transfer_metrics(&self) -> Option<&TransferMetrics<A>>
pub fn transfer_metrics(&self) -> Option<&TransferMetrics<A>>
Measured transfer-learning outcomes, or None when transfer learning is
disabled.
Sourcepub fn recommend_adaptations(
&mut self,
_current_data: &[StreamingDataPoint<A>],
performance_tracker: &PerformanceTracker<A>,
) -> Result<Vec<Adaptation<A>>, String>
pub fn recommend_adaptations( &mut self, _current_data: &[StreamingDataPoint<A>], performance_tracker: &PerformanceTracker<A>, ) -> Result<Vec<Adaptation<A>>, String>
Recommends adaptations based on current state.
_current_data is accepted for signature stability but is not read: the
meta-state the bandit consumes is [performance, resource, drift] with a
layout the feature scaler in super::meta_bandit is fitted against,
and per-batch data characteristics have no slot in it. The owning
optimizer already derives its data statistics separately
(compute_data_statistics), and resource/drift signals reach the
meta-learner through Self::update_context_signals. Feeding data
characteristics into the bandit would require widening MetaState and
refitting the scaler, which is a design change rather than a wiring fix.
Sourcepub fn apply_adaptation(
&mut self,
adaptation: &Adaptation<A>,
) -> Result<(), String>
pub fn apply_adaptation( &mut self, adaptation: &Adaptation<A>, ) -> Result<(), String>
Applies adaptation to meta-learning system
Sourcepub fn get_effectiveness_score(&self) -> f32
pub fn get_effectiveness_score(&self) -> f32
Gets meta-learning effectiveness score
Sourcepub fn get_diagnostics(&self) -> MetaLearningDiagnostics
pub fn get_diagnostics(&self) -> MetaLearningDiagnostics
Gets diagnostic information
Auto Trait Implementations§
impl<A> Freeze for MetaLearner<A>where
A: Freeze,
impl<A> RefUnwindSafe for MetaLearner<A>where
A: RefUnwindSafe,
impl<A> Send for MetaLearner<A>
impl<A> Sync for MetaLearner<A>
impl<A> Unpin for MetaLearner<A>where
A: Unpin,
impl<A> UnsafeUnpin for MetaLearner<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for MetaLearner<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> 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.