Skip to main content

LearnedOptimizer

Struct LearnedOptimizer 

Source
pub struct LearnedOptimizer { /* private fields */ }
Expand description

Learned optimizer.

Implementations§

Source§

impl LearnedOptimizer

Source

pub fn new() -> Self

Create a new learned optimizer with default settings.

Source

pub fn with_strategy(self, strategy: LearningStrategy) -> Self

Set learning strategy.

Source

pub fn with_model_type(self, model_type: ModelType) -> Self

Set model type.

Source

pub fn with_learning_rate(self, rate: f64) -> Self

Set learning rate.

Source

pub fn extract_features( &self, graph_desc: &HashMap<String, f64>, ) -> Result<FeatureVector, LearnedOptError>

Extract features from graph description.

Source

pub fn observe( &mut self, features: FeatureVector, actual_cost: f64, ) -> Result<(), LearnedOptError>

Observe execution and update model (online learning).

Source

pub fn observe_reward( &mut self, signal: RewardSignal, ) -> Result<(), LearnedOptError>

Observe reward signal for reinforcement learning.

Source

pub fn predict_cost( &self, features: &FeatureVector, ) -> Result<CostPrediction, LearnedOptError>

Predict cost for given features.

Source

pub fn recommend_fusion( &self, features: &FeatureVector, ) -> Result<FusionRecommendation, LearnedOptError>

Recommend whether to fuse operations.

Source

pub fn get_stats(&self) -> &LearningStats

Get learning statistics.

Source

pub fn evaluate_accuracy(&mut self) -> Result<f64, LearnedOptError>

Evaluate model accuracy on training data.

Source

pub fn reset(&mut self)

Reset learning state.

Trait Implementations§

Source§

impl Default for LearnedOptimizer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V