public class BertPretrainingLoss extends AbstractCompositeLoss
componentstotalInstances| Constructor and Description |
|---|
BertPretrainingLoss()
Creates a loss combining the next sentence and masked language loss for bert pretraining.
|
| Modifier and Type | Method and Description |
|---|---|
BertMaskedLanguageModelLoss |
getBertMaskedLanguageModelLoss()
gets BertMaskedLanguageModelLoss.
|
BertNextSentenceLoss |
getBertNextSentenceLoss()
gets BertNextSentenceLoss.
|
protected ai.djl.util.Pair<NDList,NDList> |
inputForComponent(int componentIndex,
NDList labels,
NDList predictions)
Returns the inputs to computing the loss for a component loss.
|
addAccumulator, evaluate, getAccumulator, getComponents, resetAccumulator, updateAccumulatorelasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, hingeLoss, hingeLoss, hingeLoss, l1Loss, l1Loss, l1Loss, l1WeightedDecay, l1WeightedDecay, l1WeightedDecay, l2Loss, l2Loss, l2Loss, l2WeightedDecay, l2WeightedDecay, l2WeightedDecay, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLosscheckLabelShapes, checkLabelShapes, getNamepublic BertPretrainingLoss()
protected ai.djl.util.Pair<NDList,NDList> inputForComponent(int componentIndex, NDList labels, NDList predictions)
AbstractCompositeLossinputForComponent in class AbstractCompositeLosscomponentIndex - the index of the component losslabels - the label input to the composite losspredictions - the predictions input to the composite losspublic BertNextSentenceLoss getBertNextSentenceLoss()
public BertMaskedLanguageModelLoss getBertMaskedLanguageModelLoss()