({{, (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting]) 
is an option for (RefLink[NetTrain, paclet:ref/NetTrain]) and related functions that specifies how to report the progress of training.}})

OpenersNotesSection(Spacer1)Details

The following settings for (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting]) can be used:

The default setting of (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->(RefLink[Automatic, paclet:ref/Automatic]) will use "Panel" when a local notebook front end is evaluable; otherwise, it will use "Print".

Setting (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->{form,"Interval"->n} will report progress every n seconds.

Setting (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->{form,"Interval"->(RefLink[Quantity, paclet:ref/Quantity])[n,"unit"]} specifies the interval at which to report progress. Possible forms of "unit" include:

The default interval depends on the form of reporting:

Setting (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->{form,…,"MinimumInterval"->n} specifies that progress should not be reported more frequently than once every n seconds.

The default minimum interval for (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->(RefLink[Function, paclet:ref/Function])[…] is 0.05 seconds. For all other reporting types, there is no minimum interval.

The pure function in (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->(RefLink[Function, paclet:ref/Function])[…] will be supplied with the association described in (RefLink[TrainingProgressFunction, paclet:ref/TrainingProgressFunction]).

The following file extensions are supported for (RefLink[TrainingProgressReporting, paclet:ref/TrainingProgressReporting])->(RefLink[File, paclet:ref/File])[…]:

For TrainingProgressReporting->"Print" and TrainingProgressReporting->(RefLink[File, paclet:ref/File])[…], some measurements specified via (RefLink[TrainingProgressMeasurements, paclet:ref/TrainingProgressMeasurements]) may be reported in aggregated form or not reported at all. For class-based measurements like "Precision", "Recall", "F1Score", etc., the macro-average is reported. For nonscalar (RefLink[NetPort, paclet:ref/NetPort])[…] measurements, the scalar mean is reported. For "ROCCurve" and "ConfusionMatrix", no value is reported.

OpenersPrimaryExamplesSection(Spacer1)Examples  (9)

OpenersExampleSection0(Spacer1)Basic Examples  (6)

Show training progress interactively during training:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],TrainingProgressReporting->"Panel"];

Print training progress periodically during training:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->2,TrainingProgressMeasurements->None,TrainingProgressReporting->"Print"];

Show a simple progress indicator:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->1,TrainingProgressReporting->"ProgressIndicator"];

Perform custom reporting:

gradientNorms[assoc_]:=BarChart[Log[Max[Abs[Normal[#]]]]&/@assoc,ChartLabels->Automatic,BarOrigin->Right];

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->1,TrainingProgressReporting->{Function[gradientNorms[#Gradients]],"Interval"->Quantity[1,"Seconds"]}];

Write training progress information to a file:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->2,TrainingProgressReporting->File["tmp.csv"]];
FilePrint["tmp.csv"];
DeleteFile["tmp.csv"];

Do not report progress:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->1,TrainingProgressReporting->None];

OpenersExampleSection1(Spacer1)Options  (1)

Print training progress periodically with an interval of 3 seconds:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->1,TrainingProgressMeasurements->None,TrainingProgressReporting->{"Print","Interval"->Quantity[3,"Seconds"]}];

Print training progress periodically with an interval of 100 batches and a minimum interval of 10 seconds:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],MaxTrainingRounds->1,TrainingProgressMeasurements->None,TrainingProgressReporting->{"Print","Interval"->Quantity[100,"Batches"], "MinimumInterval"->Quantity[10,"Seconds"]}];

OpenersExampleSection2(Spacer1)Properties & Relations  (1)

Requested (RefLink[TrainingProgressMeasurements, paclet:ref/TrainingProgressMeasurements]) will be reported for the "Panel", (RefLink["Print", paclet:ref/menuitem/Print]) and (RefLink[File, paclet:ref/File])[…] reporting types:

NetTrain[NetModel["LeNet"],ResourceData["MNIST"],TrainingProgressMeasurements ->{"Accuracy","F1Score","AreaUnderROCCurve"},TrainingProgressReporting->"Panel"];

OpenersExampleSection3(Spacer1)Neat Examples  (1)

Monitor the solution while training a net to solve a least-squares problem. First generate training data:

data=Table[x->Sin[10x]*Exp[-x^2],{x,-3,3,.02}];

plotData[points_,color_]:=ListLinePlot[points,PlotStyle->color,FrameTicks->False,PlotRangePadding->0.1,Frame->True,PlotRange->All]

plot=plotData[data[[All,2]],GrayLevel[0.7]]

Create a network to fit the data:

net=NetChain[{10,Ramp,10,Tanh,1},"Input"->"Scalar","Output"->"Scalar"]

Replace the default progress panel with a dynamically updated plot of the current behavior of the net:

plotSolution[net_,t_]:=Show[plot,plotData[net@Range[-3,3,.02],Red],Epilog->Text[t,{10,0.9},{-1,0}]]

trained=NetTrain[net,data,MaxTrainingRounds->Quantity[10,"Seconds"],TrainingProgressReporting->{plotSolution[#Net,#AbsoluteBatch]&,"Interval"->0.1}];

Plot the final net after 10 seconds of training:

plotSolution[trained,""]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[NetTrain, paclet:ref/NetTrain])  ▪  (RefLink[TrainingProgressFunction, paclet:ref/TrainingProgressFunction])  ▪  (RefLink[TrainingProgressCheckpointing, paclet:ref/TrainingProgressCheckpointing])  ▪  (RefLink[NetTrainResultsObject, paclet:ref/NetTrainResultsObject])  ▪  (RefLink[NetInformation, paclet:ref/NetInformation])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Neural Networks in the Wolfram Language, paclet:tutorial/NeuralNetworksOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Neural Networks, paclet:guide/NeuralNetworks])}})}})