class_docstr: Class for the Fisher information metric on Dirichlet distributions.
class_docstr_tok: ["Class","for","the","Fisher","information","metric","on","Dirichlet","distributions","."]
docstr: Compute the inner-product matrix.
  
  Compute the inner-product matrix of the Fisher information metric
  at the tangent space at base point.
  
  Parameters
  ----------
  base_point : array-like, shape=[..., dim]
      Base point.
  
  Returns
  -------
  mat : array-like, shape=[..., dim, dim]
      Inner-product matrix.
docstr_tok: ["Compute","the","inner-product","matrix",".","Compute","the","inner-product","matrix","of","the","Fisher","information","metric","at","the","tangent","space","at","base","point",".","Parameters","--","--","--","--","--","base_point",":","array-like",",","shape=","[","...",",","dim","]","Base","point",".","Returns","--","--","--","-","mat",":","array-like",",","shape=","[","...",",","dim",",","dim","]","Inner-product","matrix","."]
code: def metric_matrix(self, base_point):
      """Compute the inner-product matrix.
  
      Compute the inner-product matrix of the Fisher information metric
      at the tangent space at base point.
  
      Parameters
      ----------
      base_point : array-like, shape=[..., dim]
          Base point.
  
      Returns
      -------
      mat : array-like, shape=[..., dim, dim]
          Inner-product matrix.
      """
      base_point = gs.to_ndarray(base_point, to_ndim=2)
      n_points = base_point.shape[0]
  
      mat_ones = gs.ones((n_points, self._space.dim, self._space.dim))
      poly_sum = gs.polygamma(1, gs.sum(base_point, -1))
      mat_diag = from_vector_to_diagonal_matrix(
          gs.polygamma(1, base_point)
      )
  
      mat = mat_diag - gs.einsum("i,ijk->ijk", poly_sum, mat_ones)
      return gs.squeeze(mat)
  
imports: import math
  import numpy
  from scipy.optimize import minimize
  from scipy.stats import dirichlet
  import geomstats.backend
  from geomstats.algebra_utils import from_vector_to_diagonal_matrix
  from geomstats.geometry.base import VectorSpaceOpenSet
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.information_geometry.base import InformationManifoldMixin, ScipyMultivariateRandomVariable
  from geomstats.numerics.bvp import ScipySolveBVP
  from geomstats.numerics.geodesic import ExpODESolver, LogODESolver
  from geomstats.numerics.ivp import ScipySolveIVP
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 2 for calling the DirichletMetric obj's underlying member method code with example usage: obj.metric_matrix(base_point) and returns: gs