pub struct AdamW8bit {
pub learning_rate: f32,
pub beta1: f32,
pub beta2: f32,
pub epsilon: f32,
pub weight_decay: f32,
pub step: usize,
pub momentum_states: HashMap<String, QuantizedState>,
pub variance_states: HashMap<String, QuantizedState>,
}Fields§
§learning_rate: f32§beta1: f32§beta2: f32§epsilon: f32§weight_decay: f32§step: usize§momentum_states: HashMap<String, QuantizedState>§variance_states: HashMap<String, QuantizedState>Implementations§
Source§impl AdamW8bit
impl AdamW8bit
pub fn new(learning_rate: f32) -> Self
pub fn with_config( learning_rate: f32, beta1: f32, beta2: f32, epsilon: f32, weight_decay: f32, ) -> Self
pub fn step( &mut self, parameters: &mut HashMap<String, Tensor>, gradients: &HashMap<String, Tensor>, ) -> Result<()>
pub fn memory_usage(&self) -> usize
pub fn memory_savings_vs_fp32(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdamW8bit
impl RefUnwindSafe for AdamW8bit
impl Send for AdamW8bit
impl Sync for AdamW8bit
impl Unpin for AdamW8bit
impl UnwindSafe for AdamW8bit
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> 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