class_docstr: Neural module which encodes BERT hidden states
docstr: Args:
      hidden_size: hidden size of the BERT model
      activation: activation function applied
      dropout: dropout ratio
      use_transformer_init: use transformer initialization
docstr_tok: ["Args",":","hidden_size",":","hidden","size","of","the","BERT","model","activation",":","activation","function","applied","dropout",":","dropout","ratio","use_transformer_init",":","use","transformer","initialization"]
code: def __init__(
      self,
      hidden_size: int,
      activation: str = "tanh",
      dropout: float = 0.0,
      use_transformer_init: bool = True,
  ) -> None:
      """
      Args:
          hidden_size: hidden size of the BERT model
          activation: activation function applied
          dropout: dropout ratio
          use_transformer_init: use transformer initialization
      """
      super().__init__(hidden_size=hidden_size, dropout=dropout)
      self.fc = nn.Linear(hidden_size, hidden_size)
  
      if activation not in ACT2FN:
          raise ValueError(
              f"{activation} is not in supported "
              + "{ACTIVATIONS_F.keys()}"
          )
  
      self.activation = ACT2FN[activation]
      self.dropout1 = nn.Dropout(dropout)
      self.dropout2 = nn.Dropout(dropout)
      self.post_init(use_transformer_init=use_transformer_init)
  
file_path: NeMo/nemo/collections/nlp/modules/dialogue_state_tracking/sgd_encoder.py
imports: from typing import Dict, Optional
  from torch import nn
  from nemo.collections.nlp.modules.common.classifier import Classifier
  from nemo.core.classes import typecheck
  from nemo.core.neural_types import ChannelType, LogitsType, NeuralType
label_desc: Use image node_id 2 to create a new SGDEncoder object from inherited base classes: Classifier with example: obj = SGDEncoder(hidden_size, activation, dropout, use_transformer_init)