class_docstr: Gradient descent for exponential barycenter.
docstr: Compute the (weighted) group exponential barycenter of `points`.
  
  Parameters
  ----------
  group : LieGroup
      Instance of the class LieGroup.
  points : array-like, shape=[n_samples, dim, dim]
      Input points lying in the Lie Group.
  weights : array-like, shape=[n_samples,]
      Weights associated to the points.
      Optional, defaults to 1 for each point if None.
  
  Returns
  -------
  exp_bar : array-like, shape=[dim, dim]
      Exponential barycenter of the input points.
docstr_tok: ["Compute","the","(","weighted",")","group","exponential","barycenter","of","`","points","`",".","Parameters","--","--","--","--","--","group",":","LieGroup","Instance","of","the","class","LieGroup",".","points",":","array-like",",","shape=","[","n_samples",",","dim",",","dim","]","Input","points","lying","in","the","Lie","Group",".","weights",":","array-like",",","shape=","[","n_samples",",","]","Weights","associated","to","the","points",".","Optional",",","defaults","to","1","for","each","point","if","None",".","Returns","--","--","--","-","exp_bar",":","array-like",",","shape=","[","dim",",","dim","]","Exponential","barycenter","of","the","input","points","."]
code: def minimize(self, group, points, weights=None):
      """Compute the (weighted) group exponential barycenter of `points`.
  
      Parameters
      ----------
      group : LieGroup
          Instance of the class LieGroup.
      points : array-like, shape=[n_samples, dim, dim]
          Input points lying in the Lie Group.
      weights : array-like, shape=[n_samples,]
          Weights associated to the points.
          Optional, defaults to 1 for each point if None.
  
      Returns
      -------
      exp_bar : array-like, shape=[dim, dim]
          Exponential barycenter of the input points.
      """
      n_samples = points.shape[0]
  
      if n_samples == 1:
          return points[0]
  
      if weights is None:
          weights = gs.ones((n_samples,))
  
      sum_weights = gs.sum(weights)
  
      mean = points[0] if self.init_point is None else self.init_point
  
      grad_norm = 0.0
  
      for iteration in range(self.max_iter):
          if not (grad_norm > self.epsilon or iteration == 0):
              break
  
          inv_mean = group.inverse(mean)
          centered_points = group.compose(inv_mean, points)
  
          logs = group.log(point=centered_points)
          tangent_mean = self.init_step_size * gs.einsum(
              "n, nk...->k...", weights / sum_weights, logs
          )
          mean_next = group.compose(
              mean, group.exp(tangent_vec=tangent_mean)
          )
  
          grad_norm = gs.linalg.norm(tangent_mean)
  
          mean = mean_next
  
      else:
          logging.warning(
              f"Maximum number of iterations {self.max_iter} reached. "
              "The mean may be inaccurate"
          )
  
      if self.verbose:
          logging.info(
              f"n_iter: {iteration}, final gradient norm: {grad_norm}"
          )
      return mean
  
file_path: geomstats/geomstats/learning/exponential_barycenter.py
imports: import logging
  from sklearn.base import BaseEstimator
  import geomstats.backend
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.learning.frechet_mean import BaseGradientDescent, LinearMean
label_desc: Use image node_id 1 for calling the GradientDescent obj's underlying member method code with example usage: obj.minimize(group, points, weights) and returns: mean, points