class_docstr: Tests of FullBatchNodeGenerator class
class_docstr_tok: ["Tests","of","FullBatchNodeGenerator","class"]
code: def test_generator_methods(self):
      link_ids = list(self.G.edges())[:10]
      Aadj = self.G.to_adjacency_matrix().toarray()
      Aadj_selfloops = (
          Aadj + np.eye(*Aadj.shape) - np.diag(Aadj.diagonal())
      )
      Dtilde = np.diag(Aadj_selfloops.sum(axis=1) ** (-0.5))
      Agcn = Dtilde.dot(Aadj_selfloops).dot(Dtilde)
      Appnp = 0.1 * np.linalg.inv(
          np.eye(Agcn.shape[0]) - ((1 - 0.1) * Agcn)
      )
  
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=True, method="none"
      )
      np.testing.assert_allclose(A_dense, Aadj)
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=False, method="none"
      )
      np.testing.assert_allclose(A_dense, Aadj)
  
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=True, method="self_loops"
      )
      np.testing.assert_allclose(A_dense, Aadj_selfloops)
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=False, method="self_loops"
      )
      np.testing.assert_allclose(A_dense, Aadj_selfloops)
  
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=True, method="gat"
      )
      np.testing.assert_allclose(A_dense, Aadj_selfloops)
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=False, method="gat"
      )
      np.testing.assert_allclose(A_dense, Aadj_selfloops)
  
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=True, method="gcn"
      )
      np.testing.assert_allclose(A_dense, Agcn)
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=False, method="gcn"
      )
      np.testing.assert_allclose(A_dense, Agcn)
  
      # Check other preprocessing options
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=True, method="sgc", k=2
      )
      np.testing.assert_allclose(A_dense, Agcn.dot(Agcn))
      A_dense, _, _ = self.generator_flow(
          self.G, link_ids, None, sparse=False, method="sgc", k=2
      )
      np.testing.assert_allclose(A_dense, Agcn.dot(Agcn))
  
      A_dense, _, _ = self.generator_flow(
          self.G,
          link_ids,
          None,
          sparse=False,
          method="ppnp",
          teleport_probability=0.1,
      )
      np.testing.assert_allclose(A_dense, Appnp)
  
      ppnp_sparse_failed = False
      try:
          A_dense, _, _ = self.generator_flow(
              self.G,
              link_ids,
              None,
              sparse=True,
              method="ppnp",
              teleport_probability=0.1,
          )
      except ValueError as e:
          ppnp_sparse_failed = True
  
      assert ppnp_sparse_failed
  
imports: from stellargraph.core.graph import *
  from stellargraph.mapper import FullBatchGenerator, FullBatchLinkGenerator, FullBatchNodeGenerator
  import networkx
  import numpy
  import random
  import pytest
  import pandas
  import scipy.sparse
  from ..test_utils.graphs import create_graph_features, example_graph_random, example_hin_1, example_graph
label_desc: Use image node_id 10 for calling the Test_FullBatchLinkGenerator obj's underlying member method code with example usage: obj.test_generator_methods() without return types