public class BertNextSentenceLoss extends Loss
totalInstances| Constructor and Description |
|---|
BertNextSentenceLoss(int labelIdx,
int nextSentencePredictionIdx)
Creates a new bert next sentence loss.
|
| Modifier and Type | Method and Description |
|---|---|
NDArray |
accuracy(NDList labels,
NDList predictions)
Calculates the fraction of correct predictions.
|
NDArray |
evaluate(NDList labels,
NDList predictions)
Calculates the evaluation between the labels and the predictions.
|
addAccumulator, elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, elasticNetWeightedDecay, getAccumulator, hingeLoss, hingeLoss, hingeLoss, l1Loss, l1Loss, l1Loss, l1WeightedDecay, l1WeightedDecay, l1WeightedDecay, l2Loss, l2Loss, l2Loss, l2WeightedDecay, l2WeightedDecay, l2WeightedDecay, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, maskedSoftmaxCrossEntropyLoss, resetAccumulator, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, updateAccumulatorcheckLabelShapes, checkLabelShapes, getNamepublic BertNextSentenceLoss(int labelIdx,
int nextSentencePredictionIdx)
labelIdx - index of the next sentence labelsnextSentencePredictionIdx - index of the next sentence prediction in the bert output