class_docstr: The functional group prediction task for self-supervised learning.
  
  Molecules have functional groups in them. This module is used for predicting
  the functional group and the problem is formulated as an multi-label classification problem.
  
  Parameters
  ----------
  functional_group_size: int,
      size of functional group
  in_features: int,
      hidden_layer size, default 128
  
  Example
  -------
  >>> from deepchem.models.torch_models.grover_layers import GroverFunctionalGroupPredictor
  >>> in_features, functional_group_size = 8, 20
  >>> num_atoms, num_bonds = 10, 20
  >>> predictor = GroverFunctionalGroupPredictor(functional_group_size=20, in_features=8)
  >>> atom_scope, bond_scope = [(0, 3), (3, 3), (6, 4)], [(0, 5), (5, 4), (9, 11)]
  >>> embeddings = {}
  >>> embeddings['bond_from_atom'] = torch.randn(num_bonds, in_features)
  >>> embeddings['bond_from_bond'] = torch.randn(num_bonds, in_features)
  >>> embeddings['atom_from_atom'] = torch.randn(num_atoms, in_features)
  >>> embeddings['atom_from_bond'] = torch.randn(num_atoms, in_features)
  >>> result = predictor(embeddings, atom_scope, bond_scope)
  
  Reference
  ---------
  .. Rong, Yu, et al. "Self-supervised graph transformer on large-scale molecular data." Advances in Neural Information Processing Systems 33 (2020): 12559-12571.
class_docstr_tok: ["The","functional","group","prediction","task","for","self-supervised","learning",".","Molecules","have","functional","groups","in","them",".","This","module","is","used","for","predicting","the","functional","group","and","the","problem","is","formulated","as","an","multi-label","classification","problem",".","Parameters","--","--","--","--","--","functional_group_size",":","int",",","size","of","functional","group","in_features",":","int",",","hidden_layer","size",",","default","128","Example","--","--","--","-",">",">",">","from","deepchem.models.torch_models.grover_layers","import","GroverFunctionalGroupPredictor",">",">",">","in_features",",","functional_group_size","=","8",",","20",">",">",">","num_atoms",",","num_bonds","=","10",",","20",">",">",">","predictor","=","GroverFunctionalGroupPredictor","(","functional_group_size=20",",","in_features=8",")",">",">",">","atom_scope",",","bond_scope","=","[","(","0",",","3",")",",","(","3",",","3",")",",","(","6",",","4",")","]",",","[","(","0",",","5",")",",","(","5",",","4",")",",","(","9",",","11",")","]",">",">",">","embeddings","=","{","}",">",">",">","embeddings","[","'bond_from_atom","'","]","=","torch.randn","(","num_bonds",",","in_features",")",">",">",">","embeddings","[","'bond_from_bond","'","]","=","torch.randn","(","num_bonds",",","in_features",")",">",">",">","embeddings","[","'atom_from_atom","'","]","=","torch.randn","(","num_atoms",",","in_features",")",">",">",">","embeddings","[","'atom_from_bond","'","]","=","torch.randn","(","num_atoms",",","in_features",")",">",">",">","result","=","predictor","(","embeddings",",","atom_scope",",","bond_scope",")","Reference","--","--","--","--","-","..","Rong",",","Yu",",","et","al",".","``","Self-supervised","graph","transformer","on","large-scale","molecular","data",".","''","Advances","in","Neural","Information","Processing","Systems","33","(","2020",")",":","12559-12571","."]
code: def __init__(self, functional_group_size: int, in_features=128):
      super(GroverFunctionalGroupPredictor, self).__init__()
  
      self.readout = GroverReadout(
          rtype="mean", in_features=in_features
      )
      self.linear_atom_from_atom = nn.Linear(
          in_features, functional_group_size
      )
      self.linear_atom_from_bond = nn.Linear(
          in_features, functional_group_size
      )
      self.linear_bond_from_atom = nn.Linear(
          in_features, functional_group_size
      )
      self.linear_bond_from_bond = nn.Linear(
          in_features, functional_group_size
      )
  
imports: from typing import List, Dict
  import numpy
  from scipy import stats
  from deepchem.models.torch_models.readout import GroverReadout
  from deepchem.models.torch_models.layers import SublayerConnection, PositionwiseFeedForward
label_desc: Use image node_id 1 to create a new GroverFunctionalGroupPredictor object from inherited base classes: nn with example: obj = GroverFunctionalGroupPredictor(functional_group_size, in_features)