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 from_huggingface_model_name(
      cls,
      vocab: Vocabulary,
      model_name: str,
      image_feature_dim: int,
      image_num_hidden_layers: int,
      image_hidden_size: int,
      image_num_attention_heads: int,
      combined_hidden_size: int,
      combined_num_attention_heads: int,
      pooled_output_dim: int,
      image_intermediate_size: int,
      image_attention_dropout: float,
      image_hidden_dropout: float,
      image_biattention_id: List[int],
      text_biattention_id: List[int],
      text_fixed_layer: int,
      image_fixed_layer: int,
      fusion_method: str = "sum",
  ):
      text_embeddings = TransformerEmbeddings.from_pretrained_module(
          model_name
      )
  
      image_embeddings = ImageFeatureEmbeddings(
          feature_size=image_feature_dim,
          embedding_size=image_hidden_size,
          dropout=image_hidden_dropout,
      )
  
      encoder = BiModalEncoder.from_pretrained_module(
          model_name,
          num_hidden_layers2=image_num_hidden_layers,
          hidden_size2=image_hidden_size,
          num_attention_heads2=image_num_attention_heads,
          combined_hidden_size=combined_hidden_size,
          combined_num_attention_heads=combined_num_attention_heads,
          intermediate_size2=image_intermediate_size,
          attention_dropout2=image_attention_dropout,
          hidden_dropout2=image_hidden_dropout,
          biattention_id1=text_biattention_id,
          biattention_id2=image_biattention_id,
          fixed_layer1=text_fixed_layer,
          fixed_layer2=image_fixed_layer,
      )
  
      return cls(
          vocab=vocab,
          text_embeddings=text_embeddings,
          image_embeddings=image_embeddings,
          encoder=encoder,
          pooled_output_dim=pooled_output_dim,
          fusion_method=fusion_method,
      )
  
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 2 for calling the VilbertBackbone obj's underlying member method code with example usage: obj.from_huggingface_model_name(cls, vocab, model_name, image_feature_dim, image_num_hidden_layers, image_hidden_size, image_num_attention_heads, combined_hidden_size, combined_num_attention_heads, pooled_output_dim, image_intermediate_size, image_attention_dropout, image_hidden_dropout, image_biattention_id, text_biattention_id, text_fixed_layer, image_fixed_layer, fusion_method) and returns: cls