class_docstr: Optimizer that implements the Lion algorithm.
  
  The Lion optimizer is a stochastic-gradient-descent method that uses the
  sign operator to control the magnitude of the update, unlike other adaptive
  optimizers such as Adam that rely on second-order moments. This make
  Lion more memory-efficient as it only keeps track of the momentum. According
  to the authors (see reference), its performance gain over Adam grows with
  the batch size. Because the update of Lion is produced through the sign
  operation, resulting in a larger norm, a suitable learning rate for Lion is
  typically 3-10x smaller than that for AdamW. The weight decay for Lion
  should be in turn 3-10x larger than that for AdamW to maintain a
  similar strength (lr * wd).
  
  Args:
      learning_rate: A float, a
          `keras.optimizers.schedules.LearningRateSchedule` instance, or
          a callable that takes no arguments and returns the actual value to
          use. The learning rate. Defaults to `0.001`.
      beta_1: A float value or a constant float tensor, or a callable
          that takes no arguments and returns the actual value to use. The
          rate to combine the current gradient and the 1st moment estimate.
          Defaults to `0.9`.
      beta_2: A float value or a constant float tensor, or a callable
          that takes no arguments and returns the actual value to use. The
          exponential decay rate for the 1st moment estimate. Defaults to
          `0.99`.
      {{base_optimizer_keyword_args}}
  
  References:
  
  - [Chen et al., 2023](http://arxiv.org/abs/2302.06675)
  - [Authors' implementation](
      http://github.com/google/automl/tree/master/lion)
docstr: Initialize optimizer variables.
  
  Lion optimizer has one variable `momentums`.
  
  Args:
      var_list: list of model variables to build Lion variables on.
docstr_tok: ["Initialize","optimizer","variables",".","Lion","optimizer","has","one","variable","`","momentums","`",".","Args",":","var_list",":","list","of","model","variables","to","build","Lion","variables","on","."]
code: def build(self, var_list):
      """Initialize optimizer variables.
  
      Lion optimizer has one variable `momentums`.
  
      Args:
          var_list: list of model variables to build Lion variables on.
      """
      if self.built:
          return
      super().build(var_list)
      self._momentums = []
      for var in var_list:
          self._momentums.append(
              self.add_variable_from_reference(
                  reference_variable=var, name="momentum"
              )
          )
  
file_path: keras/keras/optimizers/lion.py
imports: from keras import ops
  from keras.api_export import keras_export
  from keras.optimizers import optimizer
label_desc: Use image node_id 2 for calling the Lion obj's underlying member method code with example usage: obj.build(var_list) without return types