pub struct PredictionConfig {
pub history_size: usize,
pub prediction_steps: usize,
pub momentum: f32,
pub correction_weight: f32,
pub min_correlation: f32,
}Expand description
Configuration for gradient prediction.
§Example
use vsa_optim_rs::PredictionConfig;
let config = PredictionConfig::default()
.with_history_size(5)
.with_prediction_steps(4);Fields§
§history_size: usizeNumber of past gradients to keep in history.
prediction_steps: usizeNumber of steps to predict before computing full gradients.
momentum: f32Momentum factor for gradient extrapolation.
correction_weight: f32Weight applied to correction terms.
min_correlation: f32Minimum correlation threshold for using prediction.
Implementations§
Source§impl PredictionConfig
impl PredictionConfig
Sourcepub const fn with_history_size(self, size: usize) -> PredictionConfig
pub const fn with_history_size(self, size: usize) -> PredictionConfig
Set the history size.
Sourcepub const fn with_prediction_steps(self, steps: usize) -> PredictionConfig
pub const fn with_prediction_steps(self, steps: usize) -> PredictionConfig
Set the number of prediction steps.
Sourcepub const fn with_momentum(self, momentum: f32) -> PredictionConfig
pub const fn with_momentum(self, momentum: f32) -> PredictionConfig
Set the momentum factor.
Sourcepub const fn with_correction_weight(self, weight: f32) -> PredictionConfig
pub const fn with_correction_weight(self, weight: f32) -> PredictionConfig
Set the correction weight.
Trait Implementations§
Source§impl Clone for PredictionConfig
impl Clone for PredictionConfig
Source§fn clone(&self) -> PredictionConfig
fn clone(&self) -> PredictionConfig
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 PredictionConfig
impl Debug for PredictionConfig
Source§impl Default for PredictionConfig
impl Default for PredictionConfig
Source§fn default() -> PredictionConfig
fn default() -> PredictionConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PredictionConfig
impl<'de> Deserialize<'de> for PredictionConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PredictionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PredictionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PredictionConfig
impl Serialize for PredictionConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PredictionConfig
impl RefUnwindSafe for PredictionConfig
impl Send for PredictionConfig
impl Sync for PredictionConfig
impl Unpin for PredictionConfig
impl UnwindSafe for PredictionConfig
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> 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>
Converts
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>
Converts
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