oa::ml::optim::Sgd

Struct published by the oa::ml::optim module.

StRust public API

Declaration

pub struct Sgd { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn zero_grad(&self)
pub fn step(&mut self) -> Result<()>
pub const fn learning_rate(&self) -> f32
pub fn set_learning_rate(&mut self, learning_rate: f32) -> Result<()>
pub const fn step_count(&self) -> u64
fn zero_grad(&self)
fn step(&mut self) -> Result<()>
fn learning_rate(&self) -> f32
fn set_learning_rate(&mut self, learning_rate: f32) -> Result<()>
fn step_count(&self) -> u64
fn belongs_to(&self, engine: &Engine) -> bool

Associated Functions

pub fn new( parameters: impl IntoIterator<Item = Parameter>, learning_rate: f32, momentum: f32, weight_decay: f32, ) -> Result<Self>

Examples

Public Method Documentation

pub fn zero_grad( &self )
No public source comment is attached to this declaration.
pub fn step(&mut self) -> Result<()>
No public source comment is attached to this declaration.
pub const fn learning_rate( &self ) -> f32
No public source comment is attached to this declaration.
pub fn set_learning_rate(&mut self, learning_rate: f32) -> Result<()>
No public source comment is attached to this declaration.
pub const fn step_count( &self ) -> u64
No public source comment is attached to this declaration.
fn zero_grad( &self )
No public source comment is attached to this declaration.
fn step(&mut self) -> Result<()>
No public source comment is attached to this declaration.
fn learning_rate( &self ) -> f32
No public source comment is attached to this declaration.
fn set_learning_rate(&mut self, learning_rate: f32) -> Result<()>
No public source comment is attached to this declaration.
fn step_count( &self ) -> u64
No public source comment is attached to this declaration.
fn belongs_to( &self, engine: &Engine ) -> bool
No public source comment is attached to this declaration.
pub fn new( parameters: impl IntoIterator<Item = Parameter>, learning_rate: f32, momentum: f32, weight_decay: f32 ) -> Result<Self>
No public source comment is attached to this declaration.