code: def __init__(
      self,
      input_dim: int,
      mlp_dims: List[int],
      dropout: float = 0.3,
      nonlinearity: Type[nn.Module] = nn.ReLU,
      normalization: Optional[Type[nn.Module]] = nn.LayerNorm,
  ):
      super().__init__()
      self.output_dim = mlp_dims[-1]
      projection_prev_dim = input_dim
      projection_modulelist = []
  
      for mlp_dim in mlp_dims:
          projection_modulelist.append(
              nn.Linear(projection_prev_dim, mlp_dim)
          )
          projection_modulelist.append(nonlinearity())
  
          if normalization is not None:
              projection_modulelist.append(normalization(mlp_dim))
          if dropout != 0:
              projection_modulelist.append(nn.Dropout(dropout))
          projection_prev_dim = mlp_dim
  
      self.projection = nn.Sequential(*projection_modulelist)
  
file_path: mmf/mmf/models/transformers/heads/refiner.py
imports: from dataclasses import dataclass, field
  from typing import Dict, List, Optional, Type
  import torch
  from mmf.common.registry import registry
  from mmf.models.transformers.base import BaseTransformerHead
  from mmf.modules.losses import RefinerContrastiveLoss, RefinerMSLoss
  from torch import nn
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: nn with example: obj = MLP(input_dim, mlp_dims, dropout, nonlinearity, normalization)