主要内容

plotperform

绘制网络性能图

说明

plotperform(TR) 基于函数 train 所返回的训练记录 TR 绘制训练、验证和测试性能的误差对轮数的图。

示例

示例

全部折叠

此示例说明如何使用 plotperform 获得训练记录误差值对训练轮数的图。

[x,t] = bodyfat_dataset;
net = feedforwardnet(10);
[net,tr] = train(net,x,t);

Figure Neural Network Training (14-Jul-2025 06:05:59) contains an object of type uigridlayout.

plotperform(tr)

Figure Performance (plotperform) contains an axes object. The axes object with title Best Validation Performance is 26.6393 at epoch 9, xlabel 15 Epochs, ylabel Mean Squared Error (mse) contains 6 objects of type line. One or more of the lines displays its values using only markers These objects represent Train, Validation, Test, Best.

一般情况下,经过更多轮数的训练后,误差会减小,但随着网络开始过拟合训练数据,基于验证数据集的误差可能会开始增大。在默认设置中,在验证误差连续六次增大后,训练将停止,最优性能取自验证误差最低的那一轮训练。

输入参数

全部折叠

训练记录(epochperf),以结构体形式返回,其字段取决于网络训练函数 (net.NET.trainFcn)。它可以包括如下字段:

  • 训练、数据划分以及性能函数和参数

  • 训练、验证和测试集的数据划分索引

  • 训练、验证和测试集的数据划分掩码

  • 轮数 (num_epochs) 和最佳轮次 (best_epoch)

  • 训练状态名称列表 (states)

  • 每个状态名称的字段(在整个训练过程中记录其值)

  • 最佳网络的性能(best_perfbest_vperfbest_tperf

版本历史记录

在 R2008a 中推出

另请参阅