composer.models
Models provided to Trainer
must use the basic
interface specified by BaseMosaicModel
.
Additionally, for convience we provide a number of extensions of BaseMosaicModel
as detailed below.
Base Models
Implements the base logic that all Transformers can build on top off. |
Image Models
Language Models
Metrics and Loss Functions
Evaluation metrics for common tasks are
in torchmetrics
and are directly compatible with BaseMosaicModel
.
Additionally, we provide implementations of the following metrics and loss functions.
Torchmetric implementation to calculate validation loss |
|
Drop-in replacement for torch.CrossEntropy that can handle dense labels. |
|
Implements a CrossEntropyLoss metric that can be run during the validation step, and is compatible with the HF API. |
|
Subclasses the LanguageCrossEntropyLoss to provide a perplexity measurement. |