class_docstr: MLP head for transformer blocks
class_docstr_tok: ["MLP","head","for","transformer","blocks"]
docstr: MLP head for transformer blocks
  Args:
      expansion_rate: rate at which the input tensor is expanded
      dropout_rate: dropout rate
      input_shape: shape of the input tensor, with the last dimension as the
          size of channel -- [N1, ... Nn, C]
docstr_tok: ["MLP","head","for","transformer","blocks","Args",":","expansion_rate",":","rate","at","which","the","input","tensor","is","expanded","dropout_rate",":","dropout","rate","input_shape",":","shape","of","the","input","tensor",",","with","the","last","dimension","as","the","size","of","channel","--","[","N1",",","...","Nn",",","C","]"]
code: def __init__(
      self,
      in_features: int,
      mlp_dim: int,
      dropout: float,
  ) -> None:
      """
      MLP head for transformer blocks
      Args:
          expansion_rate: rate at which the input tensor is expanded
          dropout_rate: dropout rate
          input_shape: shape of the input tensor, with the last dimension as the
              size of channel -- [N1, ... Nn, C]
      """
      super().__init__()
  
      # Initialize linear layers with truncated normal
      self.fc1 = nn.Linear(
          in_features=in_features, out_features=mlp_dim
      )
      init_weights_truncated_normal(self.fc1)
      self.fc2 = torch.nn.Linear(
          in_features=mlp_dim, out_features=in_features
      )
      init_weights_truncated_normal(self.fc2)
  
      self.act = nn.GELU()
      self.dropout = nn.Dropout(p=dropout)
  
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: nn with example: obj = MLP(in_features, mlp_dim, dropout)