docstr: ivy.Container instance method variant of
  ivy.gradient_descent_update. This method simply wraps the function, and
  so the docstring for ivy.gradient_descent_update also applies to this
  method with minimal changes.
  
  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(s), the rate(s) at which the weights should be
      updated relative to the gradient.
  key_chains
      The key-chains to apply or not apply the method to. Default is ``None``.
  to_apply
      If True, the method will be applied to key_chains, otherwise key_chains
      will be skipped. Default is ``True``.
  prune_unapplied
      Whether to prune key_chains for which the function was not applied.
      Default is ``False``.
  map_sequences
      Whether to also map method to sequences (lists, tuples).
      Default is ``False``.
  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 weights, following the gradient descent updates.
  
  Examples
  --------
  With one :class:`ivy.Container` inputs:
  
  >>> w = ivy.Container(a=ivy.array([1., 2., 3.]),
  ...                      b=ivy.array([3.48, 5.72, 1.98]))
  >>> dcdw = ivy.array([0.5, 0.2, 0.1])
  >>> lr = ivy.array(0.3)
  >>> w_new = w.gradient_descent_update(dcdw, lr)
  >>> print(w_new)
  {
      a: ivy.array([0.85, 1.94, 2.97]),
      b: ivy.array([3.33, 5.66, 1.95])
  }
  
  With multiple :class:`ivy.Container` inputs:
  
  >>> w = ivy.Container(a=ivy.array([1., 2., 3.]),
  ...                      b=ivy.array([3.48, 5.72, 1.98]))
  >>> dcdw = ivy.Container(a=ivy.array([0.5, 0.2, 0.1]),
  ...                         b=ivy.array([2., 3.42, 1.69]))
  >>> lr = ivy.array(0.3)
  >>> w_new = w.gradient_descent_update(dcdw, lr)
  >>> print(w_new)
  {
      a: ivy.array([0.85, 1.94, 2.97]),
      b: ivy.array([2.88, 4.69, 1.47])
  }
docstr_tok: ["ivy.Container","instance","method","variant","of","ivy.gradient_descent_update",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","ivy.gradient_descent_update","also","applies","to","this","method","with","minimal","changes",".","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","(","s",")",",","the","rate","(","s",")","at","which","the","weights","should","be","updated","relative","to","the","gradient",".","key_chains","The","key-chains","to","apply","or","not","apply","the","method","to",".","Default","is","``","None","``",".","to_apply","If","True",",","the","method","will","be","applied","to","key_chains",",","otherwise","key_chains","will","be","skipped",".","Default","is","``","True","``",".","prune_unapplied","Whether","to","prune","key_chains","for","which","the","function","was","not","applied",".","Default","is","``","False","``",".","map_sequences","Whether","to","also","map","method","to","sequences","(","lists",",","tuples",")",".","Default","is","``","False","``",".","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","weights",",","following","the","gradient","descent","updates",".","Examples","--","--","--","--","With","one",":","class",":","`","ivy.Container","`","inputs",":",">",">",">","w","=","ivy.Container","(","a=ivy.array","(","[","1.",",","2.",",","3",".","]",")",",","...","b=ivy.array","(","[","3.48",",","5.72",",","1.98","]",")",")",">",">",">","dcdw","=","ivy.array","(","[","0.5",",","0.2",",","0.1","]",")",">",">",">","lr","=","ivy.array","(","0.3",")",">",">",">","w_new","=","w.gradient_descent_update","(","dcdw",",","lr",")",">",">",">","print","(","w_new",")","{","a",":","ivy.array","(","[","0.85",",","1.94",",","2.97","]",")",",","b",":","ivy.array","(","[","3.33",",","5.66",",","1.95","]",")","}","With","multiple",":","class",":","`","ivy.Container","`","inputs",":",">",">",">","w","=","ivy.Container","(","a=ivy.array","(","[","1.",",","2.",",","3",".","]",")",",","...","b=ivy.array","(","[","3.48",",","5.72",",","1.98","]",")",")",">",">",">","dcdw","=","ivy.Container","(","a=ivy.array","(","[","0.5",",","0.2",",","0.1","]",")",",","...","b=ivy.array","(","[","2.",",","3.42",",","1.69","]",")",")",">",">",">","lr","=","ivy.array","(","0.3",")",">",">",">","w_new","=","w.gradient_descent_update","(","dcdw",",","lr",")",">",">",">","print","(","w_new",")","{","a",":","ivy.array","(","[","0.85",",","1.94",",","2.97","]",")",",","b",":","ivy.array","(","[","2.88",",","4.69",",","1.47","]",")","}"]
code: def gradient_descent_update(
      self: ivy.Container,
      dcdw: Union[ivy.Array, ivy.NativeArray, ivy.Container],
      lr: Union[float, ivy.Array, ivy.NativeArray, ivy.Container],
      /,
      *,
      stop_gradients: Union[bool, ivy.Container] = True,
      out: ivy.Container = None,
  ) -> ivy.Container:
      """ivy.Container instance method variant of
      ivy.gradient_descent_update. This method simply wraps the function, and
      so the docstring for ivy.gradient_descent_update also applies to this
      method with minimal changes.
  
      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(s), the rate(s) at which the weights should be
          updated relative to the gradient.
      key_chains
          The key-chains to apply or not apply the method to. Default is ``None``.
      to_apply
          If True, the method will be applied to key_chains, otherwise key_chains
          will be skipped. Default is ``True``.
      prune_unapplied
          Whether to prune key_chains for which the function was not applied.
          Default is ``False``.
      map_sequences
          Whether to also map method to sequences (lists, tuples).
          Default is ``False``.
      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 weights, following the gradient descent updates.
  
      Examples
      --------
      With one :class:`ivy.Container` inputs:
  
      >>> w = ivy.Container(a=ivy.array([1., 2., 3.]),
      ...                      b=ivy.array([3.48, 5.72, 1.98]))
      >>> dcdw = ivy.array([0.5, 0.2, 0.1])
      >>> lr = ivy.array(0.3)
      >>> w_new = w.gradient_descent_update(dcdw, lr)
      >>> print(w_new)
      {
          a: ivy.array([0.85, 1.94, 2.97]),
          b: ivy.array([3.33, 5.66, 1.95])
      }
  
      With multiple :class:`ivy.Container` inputs:
  
      >>> w = ivy.Container(a=ivy.array([1., 2., 3.]),
      ...                      b=ivy.array([3.48, 5.72, 1.98]))
      >>> dcdw = ivy.Container(a=ivy.array([0.5, 0.2, 0.1]),
      ...                         b=ivy.array([2., 3.42, 1.69]))
      >>> lr = ivy.array(0.3)
      >>> w_new = w.gradient_descent_update(dcdw, lr)
      >>> print(w_new)
      {
          a: ivy.array([0.85, 1.94, 2.97]),
          b: ivy.array([2.88, 4.69, 1.47])
      }
      """
      return ivy.gradient_descent_update(
          self,
          dcdw,
          lr,
          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 5 for calling the _ContainerWithGradients obj's underlying member method code with example usage: obj.gradient_descent_update() and returns: ivy