pub struct TransformerPerformancePredictor<T: Float + Debug + ScalarOperand + Send + Sync + 'static> { /* private fields */ }Expand description
Performance predictor for transformer variants.
Wraps the real predictor from crate::adaptive::predictor: a
Xavier-initialized fixed random feature map with ridge-fitted output heads,
a bounded prediction cache with real hit accounting, and a predictive
standard deviation derived from the ridge posterior.
Before Self::train has been called, Self::predict_improvement answers
“no information” (zero means, unit uncertainty, zero confidence) instead of
the constants 0.15 / 0.92 / 0.85 / 0.05 it used to fabricate.
Implementations§
Source§impl<T: Float + Debug + ScalarOperand + Send + Sync + 'static> TransformerPerformancePredictor<T>
impl<T: Float + Debug + ScalarOperand + Send + Sync + 'static> TransformerPerformancePredictor<T>
Sourcepub fn new(config: &AdaptiveConfig<T>) -> Result<Self>
pub fn new(config: &AdaptiveConfig<T>) -> Result<Self>
Build the predictor from the adaptive configuration.
The configuration is genuinely read: prediction_horizon sizes both the
hidden feature map and the cache, and adaptation_lr supplies the ridge
coefficient (a smaller adaptation rate means a more conservative, more
strongly regularized fit).
Sourcepub fn train(
&mut self,
samples: &[PredictorSample],
) -> Result<PredictorFitReport>
pub fn train( &mut self, samples: &[PredictorSample], ) -> Result<PredictorFitReport>
Fit the prediction heads on observed (landscape+adaptation, outcome)
pairs. Returns the training RMSE of each head.
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the heads have been fitted.
Sourcepub fn cache_hit_rate(&self) -> f64
pub fn cache_hit_rate(&self) -> f64
Observed cache hit rate.
Sourcepub fn uncertainty_method(&self) -> UncertaintyMethod
pub fn uncertainty_method(&self) -> UncertaintyMethod
Uncertainty estimation method in use.
Sourcepub fn prediction_horizon(&self) -> usize
pub fn prediction_horizon(&self) -> usize
Prediction horizon this predictor was configured with.
Sourcepub fn extract_features(
landscape: &LandscapeAnalysis<T>,
adaptation: &ArchitectureAdaptation<T>,
) -> PredictionFeatures
pub fn extract_features( landscape: &LandscapeAnalysis<T>, adaptation: &ArchitectureAdaptation<T>, ) -> PredictionFeatures
Turn a landscape analysis plus a proposed adaptation into the real feature vector the network consumes.
pub fn predict_improvement( &mut self, landscape: &LandscapeAnalysis<T>, adaptation: &ArchitectureAdaptation<T>, ) -> Result<PerformancePrediction<T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TransformerPerformancePredictor<T>where
PredictorNetwork<T>: Freeze,
impl<T> RefUnwindSafe for TransformerPerformancePredictor<T>where
PredictorNetwork<T>: RefUnwindSafe,
impl<T> Send for TransformerPerformancePredictor<T>where
PredictorNetwork<T>: Send,
impl<T> Sync for TransformerPerformancePredictor<T>where
PredictorNetwork<T>: Sync,
impl<T> Unpin for TransformerPerformancePredictor<T>where
PredictorNetwork<T>: Unpin,
impl<T> UnsafeUnpin for TransformerPerformancePredictor<T>where
PredictorNetwork<T>: UnsafeUnpin,
impl<T> UnwindSafe for TransformerPerformancePredictor<T>where
PredictorNetwork<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
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.