class_docstr: Uses a Vilbert model as a `Backbone`.
  Registered as a `Backbone` with name "vilbert".
class_docstr_tok: ["Uses","a","Vilbert","model","as","a","`","Backbone","`",".","Registered","as","a","`","Backbone","`","with","name","``","vilbert","''","."]
code: def __init__(
      self,
      vocab: Vocabulary,
      text_embeddings: TransformerEmbeddings,
      image_embeddings: ImageFeatureEmbeddings,
      encoder: BiModalEncoder,
      pooled_output_dim: int,
      fusion_method: str = "sum",
      dropout: float = 0.1,
      vocab_namespace: str = "tokens",
  ) -> None:
      super().__init__()
      self.fusion_method = fusion_method
      self.text_embeddings = text_embeddings
      self.image_embeddings = image_embeddings
      self.encoder = encoder
  
      self.t_pooler = TransformerPooler(
          encoder.hidden_size1, pooled_output_dim
      )
      self.v_pooler = TransformerPooler(
          encoder.hidden_size2, pooled_output_dim
      )
      self.dropout = torch.nn.Dropout(dropout)
  
      self._vocab = vocab
      self._namespace = vocab_namespace
  
file_path: allennlp/allennlp/modules/backbones/vilbert_backbone.py
imports: import logging
  from typing import Dict, List
  import torch
  from allennlp.data.fields.text_field import TextFieldTensors
  from allennlp.data.vocabulary import Vocabulary
  from allennlp.modules.backbones.backbone import Backbone
  from allennlp.modules.transformer import BiModalEncoder, ImageFeatureEmbeddings, TransformerEmbeddings, TransformerPooler
label_desc: Use image node_id 1 to create a new VilbertBackbone object from inherited base classes: Backbone with example: obj = VilbertBackbone(vocab, text_embeddings, image_embeddings, encoder, pooled_output_dim, fusion_method, dropout, vocab_namespace)