composer.models.bert.bert_hparams#

composer.models.bert.bert_hparams

Functions

dataclass

Returns the same class as was passed in, with dunder methods added based on the fields defined in the class.

Hparams

These classes are used with yahp for YAML-based configuration.

BERTForClassificationHparams

composer.models.bert.bert_hparams.BERTForClassificationHparams

BERTHparams

composer.models.bert.bert_hparams.BERTHparams

TransformerHparams

Defines the necessary hyparameters for a Transformer base module.

Attributes

  • TYPE_CHECKING

class composer.models.bert.bert_hparams.BERTForClassificationHparams(initializers: List[composer.models.model_hparams.Initializer] = <factory>, num_classes: Union[int, NoneType] = None, tokenizer_name: str = None, pretrained_model_name: Union[str, NoneType] = None, model_config: Dict[str, Union[str, float, int, NoneType, List[ForwardRef('JSON')], Dict[str, ForwardRef('JSON')]]] = <factory>, use_pretrained: bool = False, gradient_checkpointing: bool = False, num_labels: int = 2)[source]#

Bases: composer.models.transformer_hparams.TransformerHparams

composer.models.bert.bert_hparams.BERTForClassificationHparams

class composer.models.bert.bert_hparams.BERTHparams(initializers: List[composer.models.model_hparams.Initializer] = <factory>, num_classes: Union[int, NoneType] = None, tokenizer_name: str = None, pretrained_model_name: Union[str, NoneType] = None, model_config: Dict[str, Union[str, float, int, NoneType, List[ForwardRef('JSON')], Dict[str, ForwardRef('JSON')]]] = <factory>, use_pretrained: bool = False, gradient_checkpointing: bool = False)[source]#

Bases: composer.models.transformer_hparams.TransformerHparams

composer.models.bert.bert_hparams.BERTHparams