BERTForClassificationHparams#

class composer.models.BERTForClassificationHparams(initializers=<factory>, num_classes=None, num_labels=2, pretrained_model_name=None, model_config=<factory>, use_pretrained=False, tokenizer_name=None, gradient_checkpointing=False)[source]#

YAHP interface for BERTModel.

Parameters
  • num_labels (int, optional) โ€“ The number of classes in the classification task. Default: 2.

  • pretrained_model_name (str, optional) โ€“ Pretrained model name to pull from Hugging Face Model Hub.

  • model_config (Dict[str, JSON]) โ€“ A dictionary providing a HuggingFace model configuration.

  • use_pretrained (bool, optional) โ€“ Whether to initialize the model with the pretrained weights.

  • tokenizer_name (Optional[str]) โ€“ The tokenizer used for this model, necessary to assert required model inputs. Default None.

  • gradient_checkpointing (bool, optional) โ€“ Use gradient checkpointing. default: False.