pub struct TensorFlowAdamW { /* private fields */ }Expand description
TensorFlow-compatible AdamW optimizer
Implementations§
Source§impl TensorFlowAdamW
impl TensorFlowAdamW
Sourcepub fn new(
learning_rate: f64,
beta_1: f64,
beta_2: f64,
epsilon: f64,
weight_decay: f64,
clipnorm: Option<f64>,
clipvalue: Option<f64>,
global_clipnorm: Option<f64>,
use_ema: bool,
ema_momentum: f64,
jit_compile: bool,
name: Option<String>,
) -> Result<Self>
pub fn new( learning_rate: f64, beta_1: f64, beta_2: f64, epsilon: f64, weight_decay: f64, clipnorm: Option<f64>, clipvalue: Option<f64>, global_clipnorm: Option<f64>, use_ema: bool, ema_momentum: f64, jit_compile: bool, name: Option<String>, ) -> Result<Self>
Create new TensorFlow-compatible AdamW optimizer
Sourcepub fn with_defaults() -> Result<Self>
pub fn with_defaults() -> Result<Self>
Create with default parameters
Sourcepub fn with_schedule(
schedule: Box<dyn TensorFlowLearningRateSchedule>,
beta_1: f64,
beta_2: f64,
epsilon: f64,
weight_decay: f64,
clipnorm: Option<f64>,
clipvalue: Option<f64>,
global_clipnorm: Option<f64>,
use_ema: bool,
ema_momentum: f64,
jit_compile: bool,
name: Option<String>,
) -> Result<Self>
pub fn with_schedule( schedule: Box<dyn TensorFlowLearningRateSchedule>, beta_1: f64, beta_2: f64, epsilon: f64, weight_decay: f64, clipnorm: Option<f64>, clipvalue: Option<f64>, global_clipnorm: Option<f64>, use_ema: bool, ema_momentum: f64, jit_compile: bool, name: Option<String>, ) -> Result<Self>
Create with learning rate schedule
Trait Implementations§
Source§impl TensorFlowOptimizer for TensorFlowAdamW
impl TensorFlowOptimizer for TensorFlowAdamW
Source§fn apply_gradients(
&mut self,
grads_and_vars: &[(Tensor, String)],
global_step: Option<i64>,
) -> Result<()>
fn apply_gradients( &mut self, grads_and_vars: &[(Tensor, String)], global_step: Option<i64>, ) -> Result<()>
Apply gradients to variables
Source§fn minimize(
&mut self,
loss_fn: Box<dyn Fn() -> Result<Tensor>>,
var_list: &[String],
global_step: Option<i64>,
) -> Result<Tensor>
fn minimize( &mut self, loss_fn: Box<dyn Fn() -> Result<Tensor>>, var_list: &[String], global_step: Option<i64>, ) -> Result<Tensor>
Minimize loss function
Source§fn get_config(&self) -> TensorFlowOptimizerConfig
fn get_config(&self) -> TensorFlowOptimizerConfig
Get optimizer configuration
Source§fn get_weights(&self) -> Vec<Tensor>
fn get_weights(&self) -> Vec<Tensor>
Get optimizer weights
Source§fn get_learning_rate(&self) -> f64
fn get_learning_rate(&self) -> f64
Get learning rate
Auto Trait Implementations§
impl Freeze for TensorFlowAdamW
impl !RefUnwindSafe for TensorFlowAdamW
impl Send for TensorFlowAdamW
impl Sync for TensorFlowAdamW
impl Unpin for TensorFlowAdamW
impl !UnwindSafe for TensorFlowAdamW
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