pub struct PerformancePredictor<T: Float + Debug + Send + Sync + 'static> { /* private fields */ }Expand description
Performance prediction system.
Wraps the real learned predictor in crate::evaluation::PerformancePredictor
(a ridge-regularised linear model over a deterministic architecture feature
vector, trained online from observed evaluations). Earlier releases returned
a constant 0.6 here.
Implementations§
Source§impl<T: Float + Debug + Default + Send + Sync + 'static> PerformancePredictor<T>
impl<T: Float + Debug + Default + Send + Sync + 'static> PerformancePredictor<T>
pub fn new(config: &EvaluationConfig<T>) -> Result<Self>
Sourcepub fn predict(
&mut self,
architecture: &OptimizerArchitecture<T>,
) -> Result<EvaluationResults<T>>
pub fn predict( &mut self, architecture: &OptimizerArchitecture<T>, ) -> Result<EvaluationResults<T>>
Predict the performance of an architecture without running it.
Delegates to the learned model, which extracts a deterministic feature vector from the architecture and scores it; the returned confidence interval widens when little training data has been seen.
Sourcepub fn update_training_data(
&mut self,
results: &[SearchResult<T>],
) -> Result<()>
pub fn update_training_data( &mut self, results: &[SearchResult<T>], ) -> Result<()>
Feed observed evaluations back into the model.
Each result performs one online gradient step on the predictor’s weights, and the running prediction accuracy (1 - mean absolute error over the retained history) is refreshed.
Sourcepub fn prediction_accuracy(&self) -> T
pub fn prediction_accuracy(&self) -> T
Current estimated prediction accuracy in [0, 1].
Sourcepub fn confidence_threshold(&self) -> T
pub fn confidence_threshold(&self) -> T
Minimum accuracy at which the predictor should be trusted in place of a full evaluation.
Sourcepub fn model_type(&self) -> &PredictorType
pub fn model_type(&self) -> &PredictorType
Kind of model backing this predictor.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of (architecture, evaluation) pairs observed so far.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for PerformancePredictor<T>
impl<T> RefUnwindSafe for PerformancePredictor<T>where
PerformancePredictor<T>: RefUnwindSafe,
Vec<(OptimizerArchitecture<T>, EvaluationResults<T>)>: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PerformancePredictor<T>
impl<T> Sync for PerformancePredictor<T>
impl<T> Unpin for PerformancePredictor<T>where
PerformancePredictor<T>: Unpin,
Vec<(OptimizerArchitecture<T>, EvaluationResults<T>)>: Unpin,
T: Unpin,
impl<T> UnsafeUnpin for PerformancePredictor<T>where
PerformancePredictor<T>: UnsafeUnpin,
Vec<(OptimizerArchitecture<T>, EvaluationResults<T>)>: UnsafeUnpin,
T: UnsafeUnpin,
impl<T> UnwindSafe for PerformancePredictor<T>where
PerformancePredictor<T>: UnwindSafe,
Vec<(OptimizerArchitecture<T>, EvaluationResults<T>)>: UnwindSafe,
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 more