docstr: Update weights ws of some function, given the derivatives of some
  cost c with respect to ws, [dc/dw for w in ws], by applying Layerwise
  Adaptive Rate Scaling (LARS) method.
  
  Parameters
  ----------
  self
      Weights of the function to be updated.
  dcdw
      Derivates of the cost c with respect to the weights ws, [dc/dw for w in ws].
  lr
      Learning rate, the rate at which the weights should be updated relative to
      the gradient.
  decay_lambda
      The factor used for weight decay. Default is zero.
  stop_gradients
      Whether to stop the gradients of the variables after each gradient step.
      Default is ``True``.
  out
      optional output container, for writing the result to. It must have a shape
      that the inputs broadcast to.
  
  Returns
  -------
  ret
      The new function weights ws_new, following the LARS updates.
  
  Examples
  --------
  With one :class:`ivy.Container` inputs:
  
  >>> w = ivy.Container(a=ivy.array([3.2, 2.6, 1.3]),
  ...                    b=ivy.array([1.4, 3.1, 5.1]))
  >>> dcdw = ivy.array([0.2, 0.4, 0.1])
  >>> lr = ivy.array(0.1)
  >>> new_weights = w.lars_update(dcdw, lr)
  >>> print(new_weights)
  {
      a: ivy.array([3.01132035, 2.22264051, 1.2056601]),
      b: ivy.array([1.1324538, 2.56490755, 4.96622658])
  }
  
  With multiple :class:`ivy.Container` inputs:
  
  >>> w = ivy.Container(a=ivy.array([3.2, 2.6, 1.3]),
  ...                    b=ivy.array([1.4, 3.1, 5.1]))
  >>> dcdw = ivy.Container(a=ivy.array([0.2, 0.4, 0.1]),
  ...                       b=ivy.array([0.3,0.1,0.2]))
  >>> lr = ivy.array(0.1)
  >>> new_weights = w.lars_update(dcdw, lr)
  >>> print(new_weights)
  {
      a: ivy.array([3.01132035, 2.22264051, 1.2056601]),
      b: ivy.array([0.90848625, 2.93616199, 4.77232409])
  }
docstr_tok: ["Update","weights","ws","of","some","function",",","given","the","derivatives","of","some","cost","c","with","respect","to","ws",",","[","dc\/dw","for","w","in","ws","]",",","by","applying","Layerwise","Adaptive","Rate","Scaling","(","LARS",")","method",".","Parameters","--","--","--","--","--","self","Weights","of","the","function","to","be","updated",".","dcdw","Derivates","of","the","cost","c","with","respect","to","the","weights","ws",",","[","dc\/dw","for","w","in","ws","]",".","lr","Learning","rate",",","the","rate","at","which","the","weights","should","be","updated","relative","to","the","gradient",".","decay_lambda","The","factor","used","for","weight","decay",".","Default","is","zero",".","stop_gradients","Whether","to","stop","the","gradients","of","the","variables","after","each","gradient","step",".","Default","is","``","True","``",".","out","optional","output","container",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ret","The","new","function","weights","ws_new",",","following","the","LARS","updates",".","Examples","--","--","--","--","With","one",":","class",":","`","ivy.Container","`","inputs",":",">",">",">","w","=","ivy.Container","(","a=ivy.array","(","[","3.2",",","2.6",",","1.3","]",")",",","...","b=ivy.array","(","[","1.4",",","3.1",",","5.1","]",")",")",">",">",">","dcdw","=","ivy.array","(","[","0.2",",","0.4",",","0.1","]",")",">",">",">","lr","=","ivy.array","(","0.1",")",">",">",">","new_weights","=","w.lars_update","(","dcdw",",","lr",")",">",">",">","print","(","new_weights",")","{","a",":","ivy.array","(","[","3.01132035",",","2.22264051",",","1.2056601","]",")",",","b",":","ivy.array","(","[","1.1324538",",","2.56490755",",","4.96622658","]",")","}","With","multiple",":","class",":","`","ivy.Container","`","inputs",":",">",">",">","w","=","ivy.Container","(","a=ivy.array","(","[","3.2",",","2.6",",","1.3","]",")",",","...","b=ivy.array","(","[","1.4",",","3.1",",","5.1","]",")",")",">",">",">","dcdw","=","ivy.Container","(","a=ivy.array","(","[","0.2",",","0.4",",","0.1","]",")",",","...","b=ivy.array","(","[","0.3,0.1,0.2","]",")",")",">",">",">","lr","=","ivy.array","(","0.1",")",">",">",">","new_weights","=","w.lars_update","(","dcdw",",","lr",")",">",">",">","print","(","new_weights",")","{","a",":","ivy.array","(","[","3.01132035",",","2.22264051",",","1.2056601","]",")",",","b",":","ivy.array","(","[","0.90848625",",","2.93616199",",","4.77232409","]",")","}"]
code: def lars_update(
      self: ivy.Container,
      dcdw: Union[ivy.Array, ivy.NativeArray, ivy.Container],
      lr: Union[float, ivy.Array, ivy.NativeArray, ivy.Container],
      /,
      *,
      decay_lambda: Union[float, ivy.Container] = 0,
      stop_gradients: Union[bool, ivy.Container] = True,
      out: Optional[ivy.Container] = None,
  ):
      """Update weights ws of some function, given the derivatives of some
      cost c with respect to ws, [dc/dw for w in ws], by applying Layerwise
      Adaptive Rate Scaling (LARS) method.
  
      Parameters
      ----------
      self
          Weights of the function to be updated.
      dcdw
          Derivates of the cost c with respect to the weights ws, [dc/dw for w in ws].
      lr
          Learning rate, the rate at which the weights should be updated relative to
          the gradient.
      decay_lambda
          The factor used for weight decay. Default is zero.
      stop_gradients
          Whether to stop the gradients of the variables after each gradient step.
          Default is ``True``.
      out
          optional output container, for writing the result to. It must have a shape
          that the inputs broadcast to.
  
      Returns
      -------
      ret
          The new function weights ws_new, following the LARS updates.
  
      Examples
      --------
      With one :class:`ivy.Container` inputs:
  
      >>> w = ivy.Container(a=ivy.array([3.2, 2.6, 1.3]),
      ...                    b=ivy.array([1.4, 3.1, 5.1]))
      >>> dcdw = ivy.array([0.2, 0.4, 0.1])
      >>> lr = ivy.array(0.1)
      >>> new_weights = w.lars_update(dcdw, lr)
      >>> print(new_weights)
      {
          a: ivy.array([3.01132035, 2.22264051, 1.2056601]),
          b: ivy.array([1.1324538, 2.56490755, 4.96622658])
      }
  
      With multiple :class:`ivy.Container` inputs:
  
      >>> w = ivy.Container(a=ivy.array([3.2, 2.6, 1.3]),
      ...                    b=ivy.array([1.4, 3.1, 5.1]))
      >>> dcdw = ivy.Container(a=ivy.array([0.2, 0.4, 0.1]),
      ...                       b=ivy.array([0.3,0.1,0.2]))
      >>> lr = ivy.array(0.1)
      >>> new_weights = w.lars_update(dcdw, lr)
      >>> print(new_weights)
      {
          a: ivy.array([3.01132035, 2.22264051, 1.2056601]),
          b: ivy.array([0.90848625, 2.93616199, 4.77232409])
      }
      """
      return ivy.lars_update(
          self,
          dcdw,
          lr,
          decay_lambda=decay_lambda,
          stop_gradients=stop_gradients,
          out=out,
      )
  
file_path: ivy/ivy/data_classes/container/gradients.py
imports: from typing import Optional, Union, List, Dict
  import ivy
  from ivy.data_classes.container.base import ContainerBase
label_desc: Use image node_id 6 for calling the _ContainerWithGradients obj's underlying member method code with example usage: obj.lars_update() and returns: ivy