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).
docstr: Builds a Node2Vec model for node prediction.
  
  Args:
      embedding (str): "target" for target_embedding, "context" for context_embedding
  
  Returns:
      tuple: ``(x_inp, x_out)`` where ``x_inp`` is a Keras input tensor
      for the Node2Vec model and ``x_out`` is the Keras tensor
      for the Node2Vec model output.
docstr_tok: ["Builds","a","Node2Vec","model","for","node","prediction",".","Args",":","embedding","(","str",")",":","``","target","''","for","target_embedding",",","``","context","''","for","context_embedding","Returns",":","tuple",":","``","(","x_inp",",","x_out",")","``","where","``","x_inp","``","is","a","Keras","input","tensor","for","the","Node2Vec","model","and","``","x_out","``","is","the","Keras","tensor","for","the","Node2Vec","model","output","."]
code: def _node_model(self, embedding="target"):
      """
      Builds a Node2Vec model for node prediction.
  
      Args:
          embedding (str): "target" for target_embedding, "context" for context_embedding
  
      Returns:
          tuple: ``(x_inp, x_out)`` where ``x_inp`` is a Keras input tensor
          for the Node2Vec model and ``x_out`` is the Keras tensor
          for the Node2Vec model output.
  
      """
      # Create tensor inputs
      x_inp = Input(shape=(1,))
  
      # Output from Node2Vec model
      x_out = self(x_inp, embedding)
  
      return x_inp, x_out
  
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 4 for calling the Node2Vec obj's underlying member method code with example usage: obj._node_model(embedding) and returns: x_inp,  x_out