class_docstr: MLP as used in Vision Transformer, MLP-Mixer and related networks
      
docstr: Copied from Mlp above. If num_layers > 2, add more Mlp layers, doubling each time.
          
docstr_tok: ["Copied","from","Mlp","above",".","If","num_layers",">","2",",","add","more","Mlp","layers",",","doubling","each","time","."]
code: def __init__(
      self,
      in_features,
      hidden_features=None,
      out_features=None,
      act_layer=nn.GELU,
      act_fn=None,
      drop=0.0,
      device=None,
      dtype=None,
  ):
      """Copied from Mlp above. If num_layers > 2, add more Mlp layers, doubling each time."""
      factory_kwargs = {"device": device, "dtype": dtype}
      super().__init__()
      out_features = out_features or in_features
      hidden_features = hidden_features or in_features
      cur_hidden_features = hidden_features
      layers = []
      for _ in range(4):
          layers.append(
              nn.Linear(
                  in_features, cur_hidden_features, **factory_kwargs
              )
          )
          layers.append(act_layer())
          layers.append(nn.Dropout(drop))
          in_features = cur_hidden_features
          cur_hidden_features *= 2
      layers.append(
          nn.Linear(in_features, out_features, **factory_kwargs)
      )
      layers.append(nn.Dropout(drop))
      self.fwd = nn.Sequential(*layers)
  
imports: import math
  from functools import partial
  from collections import namedtuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.utils import _pair
  import hydra
  from einops import reduce, rearrange
label_desc: Use image node_id 1 to create a new MlpBig object from inherited base classes: nn with example: obj = MlpBig(in_features, hidden_features, out_features, act_layer, act_fn, drop, device, dtype)