class_docstr: Optimizer that implements the Yogi algorithm in Keras.
  
  See Algorithm 2 of
  https://papers.nips.cc/paper/8186-adaptive-methods-for-nonconvex-optimization.pdf.
class_docstr_tok: ["Optimizer","that","implements","the","Yogi","algorithm","in","Keras",".","See","Algorithm","2","of","https",":","\/\/papers.nips.cc\/paper\/8186-adaptive-methods-for-nonconvex-optimization.pdf","."]
docstr: Construct a new Yogi optimizer.
  
  Args:
    learning_rate: A Tensor or a floating point value.
      The learning rate.
    beta1: A float value or a constant float tensor.
      The exponential decay rate for the 1st moment estimates.
    beta2: A float value or a constant float tensor.
      The exponential decay rate for the 2nd moment estimates.
    epsilon: A constant trading off adaptivity and noise.
    l1_regularization_strength: A float value, must be greater than or
      equal to zero.
    l2_regularization_strength: A float value, must be greater than or
      equal to zero.
    initial_accumulator_value: The starting value for accumulators.
      Only positive values are allowed.
    activation: Use hard sign or soft tanh to determin sign.
    name: Optional name for the operations created when applying
      gradients. Defaults to "Yogi".
    **kwargs: keyword arguments. Allowed to be {`clipnorm`, `clipvalue`,
      `lr`, `decay`}. `clipnorm` is clip gradients by norm; `clipvalue`
      is clip gradients by value, `decay` is included for backward
      compatibility to allow time inverse decay of learning rate. `lr`
      is included for backward compatibility, recommended to use
      `learning_rate` instead.
docstr_tok: ["Construct","a","new","Yogi","optimizer",".","Args",":","learning_rate",":","A","Tensor","or","a","floating","point","value",".","The","learning","rate",".","beta1",":","A","float","value","or","a","constant","float","tensor",".","The","exponential","decay","rate","for","the","1st","moment","estimates",".","beta2",":","A","float","value","or","a","constant","float","tensor",".","The","exponential","decay","rate","for","the","2nd","moment","estimates",".","epsilon",":","A","constant","trading","off","adaptivity","and","noise",".","l1_regularization_strength",":","A","float","value",",","must","be","greater","than","or","equal","to","zero",".","l2_regularization_strength",":","A","float","value",",","must","be","greater","than","or","equal","to","zero",".","initial_accumulator_value",":","The","starting","value","for","accumulators",".","Only","positive","values","are","allowed",".","activation",":","Use","hard","sign","or","soft","tanh","to","determin","sign",".","name",":","Optional","name","for","the","operations","created","when","applying","gradients",".","Defaults","to","``","Yogi","''",".","*","*","kwargs",":","keyword","arguments",".","Allowed","to","be","{","`","clipnorm","`",",","`","clipvalue","`",",","`","lr","`",",","`","decay","`","}",".","`","clipnorm","`","is","clip","gradients","by","norm",";","`","clipvalue","`","is","clip","gradients","by","value",",","`","decay","`","is","included","for","backward","compatibility","to","allow","time","inverse","decay","of","learning","rate",".","`","lr","`","is","included","for","backward","compatibility",",","recommended","to","use","`","learning_rate","`","instead","."]
code: def __init__(
      self,
      learning_rate: Union[FloatTensorLike, Callable] = 0.01,
      beta1: FloatTensorLike = 0.9,
      beta2: FloatTensorLike = 0.999,
      epsilon: FloatTensorLike = 1e-3,
      l1_regularization_strength: FloatTensorLike = 0.0,
      l2_regularization_strength: FloatTensorLike = 0.0,
      initial_accumulator_value: FloatTensorLike = 1e-6,
      activation: str = "sign",
      name: str = "Yogi",
      **kwargs,
  ):
      """Construct a new Yogi optimizer.
  
      Args:
        learning_rate: A Tensor or a floating point value.
          The learning rate.
        beta1: A float value or a constant float tensor.
          The exponential decay rate for the 1st moment estimates.
        beta2: A float value or a constant float tensor.
          The exponential decay rate for the 2nd moment estimates.
        epsilon: A constant trading off adaptivity and noise.
        l1_regularization_strength: A float value, must be greater than or
          equal to zero.
        l2_regularization_strength: A float value, must be greater than or
          equal to zero.
        initial_accumulator_value: The starting value for accumulators.
          Only positive values are allowed.
        activation: Use hard sign or soft tanh to determin sign.
        name: Optional name for the operations created when applying
          gradients. Defaults to "Yogi".
        **kwargs: keyword arguments. Allowed to be {`clipnorm`, `clipvalue`,
          `lr`, `decay`}. `clipnorm` is clip gradients by norm; `clipvalue`
          is clip gradients by value, `decay` is included for backward
          compatibility to allow time inverse decay of learning rate. `lr`
          is included for backward compatibility, recommended to use
          `learning_rate` instead.
      """
      super().__init__(name, **kwargs)
      self._set_hyper("learning_rate", kwargs.get("lr", learning_rate))
      self._set_hyper("decay", self._initial_decay)
      self._set_hyper("beta_1", beta1)
      self._set_hyper("beta_2", beta2)
      self._set_hyper("epsilon", epsilon)
      self._set_hyper(
          "l1_regularization_strength", l1_regularization_strength
      )
      self._set_hyper(
          "l2_regularization_strength", l2_regularization_strength
      )
  
      self._beta1 = beta1
      self._activation = activation
      self._initial_accumulator_value = initial_accumulator_value
      self._l1_regularization_strength = l1_regularization_strength
      self._l2_regularization_strength = l2_regularization_strength
  
file_path: addons/tensorflow_addons/optimizers/yogi.py
imports: import tensorflow
  from tensorflow_addons.utils.types import FloatTensorLike
  from tensorflow_addons.optimizers import KerasLegacyOptimizer
  from typeguard import typechecked
  from typing import Union, Callable
label_desc: Use image node_id 1 to create a new Yogi object from inherited base classes: KerasLegacyOptimizer with example: obj = Yogi(learning_rate, beta1, beta2, epsilon, l1_regularization_strength, l2_regularization_strength, initial_accumulator_value, activation, name)