class_docstr: Class for learning embeddings of graphs on hyperbolic space.
  
  Parameters
  ----------
  dim : object
      Dimensions of the used hyperbolic space.
  max_epochs : int
      Maximum number of iterations for embedding.
  lr : int
      Learning rate for embedding.
  n_context : int
      Number of nodes to consider from a neighborhood
      of nodes around a particular node.
  n_negative : int
      Number of nodes to consider when searching for
      a set of nodes that are far from a particular node.
class_docstr_tok: ["Class","for","learning","embeddings","of","graphs","on","hyperbolic","space",".","Parameters","--","--","--","--","--","dim",":","object","Dimensions","of","the","used","hyperbolic","space",".","max_epochs",":","int","Maximum","number","of","iterations","for","embedding",".","lr",":","int","Learning","rate","for","embedding",".","n_context",":","int","Number","of","nodes","to","consider","from","a","neighborhood","of","nodes","around","a","particular","node",".","n_negative",":","int","Number","of","nodes","to","consider","when","searching","for","a","set","of","nodes","that","are","far","from","a","particular","node","."]
docstr: Gradient of squared hyperbolic distance.
  
  Gradient of the squared distance based on the
  Ball representation according to point_a.
  
  Parameters
  ----------
  point_a : array-like, shape=[n_samples, dim]
      First point in hyperbolic space.
  point_b : array-like, shape=[n_samples, dim]
      Second point in hyperbolic space.
  
  Returns
  -------
  dist : array-like, shape=[n_samples, 1]
      Geodesic squared distance between the two points.
docstr_tok: ["Gradient","of","squared","hyperbolic","distance",".","Gradient","of","the","squared","distance","based","on","the","Ball","representation","according","to","point_a",".","Parameters","--","--","--","--","--","point_a",":","array-like",",","shape=","[","n_samples",",","dim","]","First","point","in","hyperbolic","space",".","point_b",":","array-like",",","shape=","[","n_samples",",","dim","]","Second","point","in","hyperbolic","space",".","Returns","--","--","--","-","dist",":","array-like",",","shape=","[","n_samples",",","1","]","Geodesic","squared","distance","between","the","two","points","."]
code: def grad_squared_distance(self, point_a, point_b):
      """Gradient of squared hyperbolic distance.
  
      Gradient of the squared distance based on the
      Ball representation according to point_a.
  
      Parameters
      ----------
      point_a : array-like, shape=[n_samples, dim]
          First point in hyperbolic space.
      point_b : array-like, shape=[n_samples, dim]
          Second point in hyperbolic space.
  
      Returns
      -------
      dist : array-like, shape=[n_samples, 1]
          Geodesic squared distance between the two points.
      """
      hyperbolic_metric = self.manifold.metric
      log_map = hyperbolic_metric.log(point_b, point_a)
  
      return -2 * log_map
  
file_path: geomstats/geomstats/datasets/prepare_graph_data.py
imports: import logging
  import random
  import geomstats.backend
  from geomstats.geometry.poincare_ball import PoincareBall
label_desc: Use image node_id 4 for calling the HyperbolicEmbedding obj's underlying member method code with example usage: obj.grad_squared_distance(point_a, point_b) and returns: unknown