class_docstr: Implementation of the Node2Vec algorithm of A. Grover and J. Leskovec with Keras layers.
  see: https://snap.stanford.edu/node2vec/
  
  The model minimally requires specification of the embedding size and a generator object.
  
  .. seealso::
  
     Examples using Node2Vec:
  
     - `node classification <https://stellargraph.readthedocs.io/en/stable/demos/node-classification/keras-node2vec-node-classification.html>`__
     - `unsupervised representation learning <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/keras-node2vec-embeddings.html>`__
     - `comparison of link prediction algorithms <https://stellargraph.readthedocs.io/en/stable/demos/link-prediction/homogeneous-comparison-link-prediction.html>`__
     - using Gensim Word2Vec, not this class: `node classification <https://stellargraph.readthedocs.io/en/stable/demos/node-classification/node2vec-node-classification.html>`__, `node classification with edge weights <https://stellargraph.readthedocs.io/en/stable/demos/node-classification/node2vec-weighted-node-classification.html>`__, `link prediction <https://stellargraph.readthedocs.io/en/stable/demos/link-prediction/node2vec-link-prediction.html>`__, `unsupervised representation learning <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/node2vec-embeddings.html>`__.
  
     Appropriate data generators: :class:`.Node2VecNodeGenerator`, :class:`.Node2VecLinkGenerator`.
  
     Related functionality: :class:`.BiasedRandomWalk` does the underlying random walks.
  
  Args:
      emb_size (int): The dimension of node embeddings.
      generator (Sequence): A NodeSequence or LinkSequence.
      node_num(int, optional): The number of nodes in the given graph.
      multiplicity (int, optional): The number of nodes to process at a time. This is 1 for a node inference
        and 2 for link inference (currently no others are supported).
code: def default_model(self, flatten_output=True):
      warnings.warn(
          "The .default_model() method is deprecated. Please use .in_out_tensors() method instead.",
          DeprecationWarning,
          stacklevel=2,
      )
      return self.build()
  
file_path: stellargraph/stellargraph/layer/node2vec.py
imports: from tensorflow.keras import Input
  from tensorflow.keras.layers import Reshape, Embedding
  import math
  from tensorflow import keras
  import warnings
  from .misc import deprecated_model_function
  from ..mapper import Node2VecLinkGenerator, Node2VecNodeGenerator
label_desc: Use image node_id 7 for calling the Node2Vec obj's underlying member method code with example usage: obj.default_model(flatten_output) and returns: self