class_docstr: MLP as used in Vision Transformer, MLP-Mixer and related networks.
class_docstr_tok: ["MLP","as","used","in","Vision","Transformer",",","MLP-Mixer","and","related","networks","."]
code: def __init__(
      self,
      in_features,
      hidden_features=None,
      out_features=None,
      act_cfg=dict(type="GELU"),
      bias=True,
      drop=0.0,
  ):
      super().__init__()
      out_features = out_features or in_features
      hidden_features = hidden_features or in_features
  
      self.fc1 = nn.Linear(in_features, hidden_features, bias=bias)
      self.act = build_activation_layer(act_cfg)
      self.drop1 = nn.Dropout(drop)
      self.fc2 = nn.Linear(hidden_features, out_features, bias=bias)
      self.drop2 = nn.Dropout(drop)
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import build_activation_layer, build_norm_layer
  from mmcv.cnn.bricks import DropPath
  from mmengine.logging import MMLogger
  from mmengine.model import BaseModule
  from mmengine.runner.checkpoint import CheckpointLoader
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 to create a new Mlp object from inherited base classes: nn with example: obj = Mlp(in_features, hidden_features, out_features, act_cfg, bias, drop)