class_docstr: The nn.Module for InfoGraphStar. This class defines the forward pass of InfoGraphStar.
  
  Parameters
  ----------
  encoder: torch.nn.Module
      The encoder for InfoGraphStar.
  unsup_encoder: torch.nn.Module
      The unsupervised encoder for InfoGraph, of identical architecture to encoder.
  ff1: torch.nn.Module
      The first feedforward layer for InfoGraphStar.
  ff2: torch.nn.Module
      The second feedforward layer for InfoGraphStar.
  fc1: torch.nn.Module
      The first fully connected layer for InfoGraphStar.
  fc2: torch.nn.Module
      The second fully connected layer for InfoGraphStar.
  
  References
  ----------
  .. [1] F.-Y. Sun, J. Hoffmann, V. Verma, and J. Tang, “InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning via Mutual Maximization.” arXiv, Jan. 17, 2020. http://arxiv.org/abs/1908.01000
  
  
  Example
  -------
  >>> import torch
  >>> import numpy as np
  >>> from deepchem.models.torch_models.infograph import InfoGraphStarModel
  >>> from deepchem.feat.molecule_featurizers import MolGraphConvFeaturizer
  >>> from deepchem.feat.graph_data import BatchGraphData
  >>> num_feat = 30
  >>> num_edge = 11
  >>> infographmodular = InfoGraphStarModel(num_feat,num_edge,64)
  >>> smiles = ['C1=CC=CC=C1', 'C1=CC=CC=C1C2=CC=CC=C2']
  >>> featurizer = MolGraphConvFeaturizer(use_edges=True)
  >>> graphs = BatchGraphData(featurizer.featurize(smiles)).numpy_to_torch(infographmodular.device)
  >>> model = infographmodular.model
  >>> output = model(graphs).cpu().detach().numpy()
docstr: Forward pass for InfoGraphStar.
  
  Parameters
  ----------
  data: Union[GraphData, BatchGraphData]
      The input data, either a single graph or a batch of graphs.
docstr_tok: ["Forward","pass","for","InfoGraphStar",".","Parameters","--","--","--","--","--","data",":","Union","[","GraphData",",","BatchGraphData","]","The","input","data",",","either","a","single","graph","or","a","batch","of","graphs","."]
code: def forward(self, data):
      """
      Forward pass for InfoGraphStar.
  
      Parameters
      ----------
      data: Union[GraphData, BatchGraphData]
          The input data, either a single graph or a batch of graphs.
      """
  
      out, M = self.encoder(data)
      out = F.relu(self.fc1(out))
      pred = self.fc2(out)
      if self.mode == "classification":
          pred = torch.reshape(
              pred, (-1, self.num_tasks, self.num_classes)
          )
      return pred
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import GRU, Linear, ReLU, Sequential
  from typing import Iterable, List, Tuple, Optional, Dict, Literal
  from deepchem.metrics import to_one_hot
  import deepchem
  from deepchem.models.losses import SoftmaxCrossEntropy
  from deepchem.feat.graph_data import BatchGraphData
  from deepchem.models.losses import GlobalMutualInformationLoss, LocalMutualInformationLoss
  from deepchem.models.torch_models.layers import MultilayerPerceptron
  from deepchem.models.torch_models.modular import ModularTorchModel
label_desc: Use image node_id 3 for calling the InfoGraphStar obj's underlying member method code with example usage: obj.forward(data) and returns: pred