class_docstr: Contrastive learning method for node-level tasks proposed in the paper `Contrastive 
  Multi-View Representation Learning on Graphs (MVGRL) <https://arxiv.org/pdf/2006.05582v1.pdf>`_. 
  
  *Alias*: :obj:`dig.sslgraph.method.contrastive.model.`:obj:`NodeMVGRL`.
  
  Args:
      z_g_dim (int): The embedding dimension for graph-level (global) representations.
      z_n_dim (int): The embedding dimension for node-level (local) representations. Typically,
          when jumping knowledge is included in the encoder, we have 
          :obj:`z_g_dim` = :obj:`n_layers` * :obj:`z_n_dim`.
      diffusion_type (string, optional): Diffusion instantiation mode with two options:
          :obj:`"ppr"`: Personalized PageRank. 
          :obj:`"heat"`: heat kernel. 
          (default: :obj:`"ppr"`)
      alpha (float, optional): Teleport probability in a random walk. (default: :obj:`0.2`)
      t (int, optinal): Diffusion time. (default: :obj:`5`)
      batch_size (int, optinal): Number of subgraph samples in each minibatch. (default: :obj:`2`)
      num_nodes (int, optinal): Number of nodes sampled in each subgraph. (default: :obj:`2000`)
class_docstr_tok: ["Contrastive","learning","method","for","node-level","tasks","proposed","in","the","paper","`","Contrastive","Multi-View","Representation","Learning","on","Graphs","(","MVGRL",")","<","https",":","\/\/arxiv.org\/pdf\/2006.05582v1.pdf",">","`","_",".","*","Alias","*",":",":","obj",":","`","dig.sslgraph.method.contrastive.model.","`",":","obj",":","`","NodeMVGRL","`",".","Args",":","z_g_dim","(","int",")",":","The","embedding","dimension","for","graph-level","(","global",")","representations",".","z_n_dim","(","int",")",":","The","embedding","dimension","for","node-level","(","local",")","representations",".","Typically",",","when","jumping","knowledge","is","included","in","the","encoder",",","we","have",":","obj",":","`","z_g_dim","`","=",":","obj",":","`","n_layers","`","*",":","obj",":","`","z_n_dim","`",".","diffusion_type","(","string",",","optional",")",":","Diffusion","instantiation","mode","with","two","options",":",":","obj",":","`","``","ppr","''","`",":","Personalized","PageRank",".",":","obj",":","`","``","heat","''","`",":","heat","kernel",".","(","default",":",":","obj",":","`","``","ppr","''","`",")","alpha","(","float",",","optional",")",":","Teleport","probability","in","a","random","walk",".","(","default",":",":","obj",":","`","0.2","`",")","t","(","int",",","optinal",")",":","Diffusion","time",".","(","default",":",":","obj",":","`","5","`",")","batch_size","(","int",",","optinal",")",":","Number","of","subgraph","samples","in","each","minibatch",".","(","default",":",":","obj",":","`","2","`",")","num_nodes","(","int",",","optinal",")",":","Number","of","nodes","sampled","in","each","subgraph",".","(","default",":",":","obj",":","`","2000","`",")"]
code: def train(
      self,
      encoders,
      data_loader,
      optimizer,
      epochs,
      per_epoch_out=False,
  ):
      for encs, (proj, proj_n) in super(NodeMVGRL, self).train(
          encoders, data_loader, optimizer, epochs, per_epoch_out
      ):
          views_fn = [
              lambda x: x,
              Diffusion(mode=self.mode, alpha=self.alpha, t=self.t),
          ]
          # mvgrl for node-level tasks follows DGI, excluding the projection heads after pretraining
          mvgrl_enc = MVGRL_enc(
              encs[0],
              encs[1],
              (lambda x: x),
              (lambda x: x),
              views_fn,
              False,
              True,
          )
          yield mvgrl_enc
  
file_path: DIG/dig/sslgraph/method/contrastive/model/mvgrl.py
imports: import torch.nn
  from .contrastive import Contrastive
  from dig.sslgraph.method.contrastive.views_fn import Diffusion, DiffusionWithSample
label_desc: Use image node_id 2 for calling the NodeMVGRL obj's underlying member method code with example usage: obj.train(encoders, data_loader, optimizer, epochs, per_epoch_out) without return types