class_docstr: From BertOnlyMLMHead, BertLMPredictionHead, BertPredictionHeadTransform
class_docstr_tok: ["From","BertOnlyMLMHead",",","BertLMPredictionHead",",","BertPredictionHeadTransform"]
code: def __init__(
      self,
      hidden_size,
      vocab_size,
      layer_norm_eps=1e-12,
      hidden_act="gelu",
  ):
      super().__init__()
      self.dense = nn.Linear(hidden_size, hidden_size)
      self.transform_act_fn = (
          transformers.models.bert.modeling_bert.ACT2FN[hidden_act]
      )
      self.LayerNorm = (
          transformers.models.bert.modeling_bert.BertLayerNorm(
              hidden_size, eps=layer_norm_eps
          )
      )
  
      self.decoder = nn.Linear(hidden_size, vocab_size, bias=False)
      self.bias = nn.Parameter(
          torch.zeros(vocab_size), requires_grad=True
      )
  
      # Need a link between the two variables so that the bias is correctly resized with
      # `resize_token_embeddings`
      self.decoder.bias = self.bias
  
imports: from __future__ import annotations
  import abc
  import torch
  import torch.nn
  import transformers
  from jiant.ext.allennlp import SelfAttentiveSpanExtractor
  from jiant.shared.model_resolution import ModelArchitectures
  from jiant.tasks.core import TaskTypes
  from typing import Callable
  from typing import List
label_desc: Use image node_id 1 to create a new BertMLMHead object from inherited base classes: BaseMLMHead with example: obj = BertMLMHead(hidden_size, vocab_size, layer_norm_eps, hidden_act)