composer.models#

The models module contains the ComposerModel base class along with reference implementations of many common models. Additionally, it includes task-specific convenience ComposerModels that wrap existing Pytorch models with standard forward passes and logging to enable quick interaction with the Trainer.

See Composer Model for more details.

Functions

write_huggingface_pretrained_from_composer_checkpoint

Write a config.json and pytorch_model.bin, like transformers.PreTrainedModel.from_pretrained() expects, from a composer checkpoint

Classes

ComposerClassifier

A convenience class that creates a ComposerModel for classification tasks from a vanilla PyTorch model.

HuggingFaceModel

A wrapper class that converts ๐Ÿค— Transformers models to composer models.

Initializer

Sets the initialization scheme for different layers of a PyTorch model.