mindformers.core

MindFormers Core.

mindformers.core

mindformers.core.ClipGradNorm

Clips tensor values by the ratio of the sum of their norms.

mindformers.core.build_context

Build context.

mindformers.core.init_context

Context initialization for MindSpore.

mindformers.core.callback

mindformers.core.callback.CheckpointMointor

Checkpoint Monitor For Save LossScale

mindformers.core.callback.MFLossMonitor

Loss Monitor for classification.

mindformers.core.callback.ObsMonitor

Obs Monitor For AICC and Local

mindformers.core.callback.SummaryMonitor

Summary Monitor For AICC and Local

mindformers.core.callback.ProfileMonitor

Profile analysis in training.

mindformers.core.callback.EvalCallBack

Evaluate Callback used in training progress.

mindformers.core.loss

mindformers.core.loss.CrossEntropyLoss

Calculate the cross entropy loss.

mindformers.core.loss.L1Loss

L1Loss for parallel.

mindformers.core.loss.MSELoss

MSELoss for parallel.

mindformers.core.loss.SoftTargetCrossEntropy

SoftTargetCrossEntropy for MixUp Augment.

mindformers.core.lr

mindformers.core.lr.ConstantWarmUpLR

ConstantWarmUpLR.

mindformers.core.lr.CosineWithRestartsAndWarmUpLR

CosineWithRestartsAndWarmUpLR.

mindformers.core.lr.CosineWithWarmUpLR

CosineWithWarmUpLR.

mindformers.core.lr.LinearWithWarmUpLR

LinearWithWarmUpLR.

mindformers.core.lr.PolynomialWithWarmUpLR

PolynomialWithWarmUpLR.

mindformers.core.metric

mindformers.core.metric.EntityScore

Compute the f1, precision and recall score of each entity

mindformers.core.metric.SQuADMetric

Compute the f1, precision and recall score of each entity

mindformers.core.metric.PerplexityMetric

Compute the loss and PPL of each entity

mindformers.core.metric.ADGENMetric

Compute the f1, precision and recall score of each entity

mindformers.core.optim

mindformers.core.optim.FusedAdamWeightDecay

Implements the Adam algorithm to fix the weight decay.

mindformers.core.optim.FP32StateAdamWeightDecay

This class is almost same with the mindspore's AdamWeightDecay implements, the