class_docstr: Masked Region Feature Regression transformer head,
  From uniter paper https://arxiv.org/pdf/1909.11740.pdf
  For an example usage take a look at the unit test.
code: def __init__(
      self,
      img_embedding_weight: nn.Parameter,
      hidden_size: int = 768,
      loss_name: str = "mrfr_loss",
      mrfr_target_key: str = "mrfr_region_target",
      mrfr_mask_key: str = "mrfr_region_mask",
      img_dim: int = 2048,
      eps: float = 1e-12,
      *args,
      **kwargs,
  ):
      super().__init__()
      self.loss_name = loss_name
      self.mrfr_target_key = mrfr_target_key
      self.mrfr_mask_key = mrfr_mask_key
  
      # Head modules
      assert img_embedding_weight is not None and tuple(
          img_embedding_weight.shape
      ) == (hidden_size, img_dim), (
          "MRFR head requires 'img_embedding_weight' with shape "
          + f"({hidden_size}, {img_dim})."
      )
  
      self.linear_proj_weight = img_embedding_weight
      self.linear_proj_bias = nn.Parameter(torch.zeros(img_dim))
  
      self.feat_regress = nn.Sequential(
          nn.Linear(hidden_size, hidden_size),
          nn.GELU(),
          nn.LayerNorm(hidden_size, eps=eps),
      )
  
file_path: mmf/mmf/models/transformers/heads/mrfr.py
imports: from typing import Dict
  import torch
  import torch.nn.functional
  from mmf.common.registry import registry
  from mmf.models.transformers.heads.utils import compute_masked_hidden
  from torch import nn, Tensor
label_desc: Use image node_id 1 to create a new MRFR object from inherited base classes: nn with example: obj = MRFR(img_embedding_weight, hidden_size, loss_name, mrfr_target_key, mrfr_mask_key, img_dim, eps)