pub struct LearnedOptimizer { /* private fields */ }Expand description
Learned optimizer.
Implementations§
Source§impl LearnedOptimizer
impl LearnedOptimizer
Sourcepub fn with_strategy(self, strategy: LearningStrategy) -> Self
pub fn with_strategy(self, strategy: LearningStrategy) -> Self
Set learning strategy.
Sourcepub fn with_model_type(self, model_type: ModelType) -> Self
pub fn with_model_type(self, model_type: ModelType) -> Self
Set model type.
Sourcepub fn with_learning_rate(self, rate: f64) -> Self
pub fn with_learning_rate(self, rate: f64) -> Self
Set learning rate.
Sourcepub fn extract_features(
&self,
graph_desc: &HashMap<String, f64>,
) -> Result<FeatureVector, LearnedOptError>
pub fn extract_features( &self, graph_desc: &HashMap<String, f64>, ) -> Result<FeatureVector, LearnedOptError>
Extract features from graph description.
Sourcepub fn observe(
&mut self,
features: FeatureVector,
actual_cost: f64,
) -> Result<(), LearnedOptError>
pub fn observe( &mut self, features: FeatureVector, actual_cost: f64, ) -> Result<(), LearnedOptError>
Observe execution and update model (online learning).
Sourcepub fn observe_reward(
&mut self,
signal: RewardSignal,
) -> Result<(), LearnedOptError>
pub fn observe_reward( &mut self, signal: RewardSignal, ) -> Result<(), LearnedOptError>
Observe reward signal for reinforcement learning.
Sourcepub fn predict_cost(
&self,
features: &FeatureVector,
) -> Result<CostPrediction, LearnedOptError>
pub fn predict_cost( &self, features: &FeatureVector, ) -> Result<CostPrediction, LearnedOptError>
Predict cost for given features.
Sourcepub fn recommend_fusion(
&self,
features: &FeatureVector,
) -> Result<FusionRecommendation, LearnedOptError>
pub fn recommend_fusion( &self, features: &FeatureVector, ) -> Result<FusionRecommendation, LearnedOptError>
Recommend whether to fuse operations.
Sourcepub fn get_stats(&self) -> &LearningStats
pub fn get_stats(&self) -> &LearningStats
Get learning statistics.
Sourcepub fn evaluate_accuracy(&mut self) -> Result<f64, LearnedOptError>
pub fn evaluate_accuracy(&mut self) -> Result<f64, LearnedOptError>
Evaluate model accuracy on training data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LearnedOptimizer
impl RefUnwindSafe for LearnedOptimizer
impl Send for LearnedOptimizer
impl Sync for LearnedOptimizer
impl Unpin for LearnedOptimizer
impl UnwindSafe for LearnedOptimizer
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