pub struct SgdConfig { /* private fields */ }Expand description
Configuration to create the Sgd optimizer.
Implementations§
source§impl SgdConfig
impl SgdConfig
sourcepub fn with_weight_decay(self, weight_decay: Option<WeightDecayConfig>) -> Self
pub fn with_weight_decay(self, weight_decay: Option<WeightDecayConfig>) -> Self
Set the default value for the field.
sourcepub fn with_momentum(self, momentum: Option<MomentumConfig>) -> Self
pub fn with_momentum(self, momentum: Option<MomentumConfig>) -> Self
Set the default value for the field.
sourcepub fn with_gradient_clipping(
self,
gradient_clipping: Option<GradientClippingConfig>
) -> Self
pub fn with_gradient_clipping( self, gradient_clipping: Option<GradientClippingConfig> ) -> Self
Set the default value for the field.
source§impl SgdConfig
impl SgdConfig
sourcepub fn init<B: AutodiffBackend, M: AutodiffModule<B>>(
&self
) -> OptimizerAdaptor<Sgd<B::InnerBackend>, M, B>
pub fn init<B: AutodiffBackend, M: AutodiffModule<B>>( &self ) -> OptimizerAdaptor<Sgd<B::InnerBackend>, M, B>
Creates a new SgdConfig with default values.
Trait Implementations§
source§impl Config for SgdConfig
impl Config for SgdConfig
source§fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
Saves the configuration to a file. Read more
source§fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
source§impl<'de> Deserialize<'de> for SgdConfig
impl<'de> Deserialize<'de> for SgdConfig
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 RefUnwindSafe for SgdConfig
impl Send for SgdConfig
impl Sync for SgdConfig
impl Unpin for SgdConfig
impl UnwindSafe for SgdConfig
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