mindspore.train

Model

mindspore.train.Model

High-Level API for training or inference.

Callback

mindspore.train.BackupAndRestore

Callback to back up and restore the parameters during training.

mindspore.train.Callback

Abstract base class used to build a Callback class.

mindspore.train.CheckpointConfig

The configuration of model checkpoint.

mindspore.train.EarlyStopping

Stop training when a monitored metric has stopped improving.

mindspore.train.History

Records the network outputs and metrics information into a History object.

mindspore.train.LambdaCallback

Callback for creating simple, custom callbacks.

mindspore.train.LearningRateScheduler

Change the learning_rate during training.

mindspore.train.LossMonitor

Monitor the loss in train or monitor the loss and eval metrics in fit.

mindspore.train.ModelCheckpoint

The checkpoint callback class.

mindspore.train.OnRequestExit

Respond to the user's closing request, exit the training or eval process, and save the checkpoint and mindir.

mindspore.train.ReduceLROnPlateau

Reduce learning rate when the monitor has stopped improving.

mindspore.train.RunContext

Hold and manage information about the model.

mindspore.train.TimeMonitor

Monitor the time in train or eval process.

Evaluation Metrics

API Name

Description

Supported Platforms

mindspore.train.Accuracy

Calculates the accuracy for classification and multilabel data.

Ascend GPU CPU

mindspore.train.BleuScore

Calculates the BLEU score.

Ascend GPU CPU

mindspore.train.ConfusionMatrix

Computes the confusion matrix, which is commonly used to evaluate the performance of classification models, including binary classification and multiple classification.

Ascend GPU CPU

mindspore.train.ConfusionMatrixMetric

Computes metrics related to confusion matrix.

Ascend GPU CPU

mindspore.train.CosineSimilarity

Computes representation similarity.

Ascend GPU CPU

mindspore.train.Dice

The Dice coefficient is a set similarity metric.

Ascend GPU CPU

mindspore.train.F1

Calculates the F1 score.

Ascend GPU CPU

mindspore.train.Fbeta

Calculates the Fbeta score.

Ascend GPU CPU

mindspore.train.HausdorffDistance

Calculates the Hausdorff distance.

Ascend GPU CPU

mindspore.train.Loss

Calculates the average of the loss.

Ascend GPU CPU

mindspore.train.MAE

Calculates the mean absolute error(MAE).

Ascend GPU CPU

mindspore.train.MeanSurfaceDistance

Computes the Average Surface Distance from y_pred to y under the default setting.

Ascend GPU CPU

mindspore.train.Metric

Base class of metric, which is used to evaluate metrics.

Ascend GPU CPU

mindspore.train.MSE

Measures the mean squared error(MSE).

Ascend GPU CPU

mindspore.train.OcclusionSensitivity

Calculates the occlusion sensitivity of the model for a given image, which illustrates which parts of an image are most important for a network's classification.

Ascend GPU CPU

mindspore.train.Perplexity

Computes perplexity.

Ascend GPU CPU

mindspore.train.Precision

Calculates precision for classification and multilabel data.

Ascend GPU CPU

mindspore.train.Recall

Calculates recall for classification and multilabel data.

Ascend GPU CPU

mindspore.train.ROC

Calculates the ROC curve.

Ascend GPU CPU

mindspore.train.RootMeanSquareDistance

Computes the Root Mean Square Surface Distance from y_pred to y under the default setting.

Ascend GPU CPU

mindspore.train.Top1CategoricalAccuracy

Calculates the top-1 categorical accuracy.

Ascend GPU CPU

mindspore.train.Top5CategoricalAccuracy

Calculates the top-5 categorical accuracy.

Ascend GPU CPU

mindspore.train.TopKCategoricalAccuracy

Calculates the top-k categorical accuracy.

Ascend GPU CPU

Utils

API Name

Description

Supported Platforms

mindspore.train.auc

Computes the AUC(Area Under the Curve) using the trapezoidal rule.

Ascend GPU CPU

mindspore.train.get_metric_fn

Gets the metric method based on the input name.

Ascend GPU CPU

mindspore.train.names

Gets all names of the metric methods.

Ascend GPU CPU

mindspore.train.rearrange_inputs

This decorator is used to rearrange the inputs according to its indexes attribute of the class.

Ascend GPU CPU

Thor

mindspore.train.ConvertModelUtils

Convert model to thor model.

mindspore.train.ConvertNetUtils

Convert net to thor layer net, used to compute and store second-order information matrix.