pub struct LearningStrategy {
pub name: String,
pub description: String,
pub hyperparams: HashMap<String, f32>,
pub preferred_features: TaskFeatures,
pub success_rate: f32,
pub usage_count: u64,
}Expand description
A learning strategy discovered through meta-learning.
Fields§
§name: StringStrategy name.
description: StringDescription of when to use this strategy.
hyperparams: HashMap<String, f32>Hyperparameters for this strategy.
preferred_features: TaskFeaturesWhich task features favor this strategy.
success_rate: f32Success rate when applied.
usage_count: u64Number of times used.
Implementations§
Source§impl LearningStrategy
impl LearningStrategy
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set description.
Sourcepub fn with_hyperparam(self, name: impl Into<String>, value: f32) -> Self
pub fn with_hyperparam(self, name: impl Into<String>, value: f32) -> Self
Set hyperparameter.
Sourcepub fn with_preferred_features(self, features: TaskFeatures) -> Self
pub fn with_preferred_features(self, features: TaskFeatures) -> Self
Set preferred features.
Sourcepub fn score_for_task(&self, task: &TaskFeatures) -> f32
pub fn score_for_task(&self, task: &TaskFeatures) -> f32
Score how well this strategy fits a task.
Sourcepub fn record_usage(&mut self, succeeded: bool)
pub fn record_usage(&mut self, succeeded: bool)
Record usage outcome.
Trait Implementations§
Source§impl Clone for LearningStrategy
impl Clone for LearningStrategy
Source§fn clone(&self) -> LearningStrategy
fn clone(&self) -> LearningStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LearningStrategy
impl Debug for LearningStrategy
Source§impl<'de> Deserialize<'de> for LearningStrategy
impl<'de> Deserialize<'de> for LearningStrategy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LearningStrategy
impl RefUnwindSafe for LearningStrategy
impl Send for LearningStrategy
impl Sync for LearningStrategy
impl Unpin for LearningStrategy
impl UnsafeUnpin for LearningStrategy
impl UnwindSafe for LearningStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request