为什么我的验证设置为空(matlab-patternnet)?

发布于 2025-01-19 22:45:31 字数 838 浏览 1 评论 0原文

我在自定义输入数据上使用简单的演示代码。 我遇到了奇怪的问题,我的验证集是空的,并且只监视测试集的性能(可能是第一个问题的第二个问题结果)。

>> size(x)

ans =

    25   764

>> size(t)

ans =

     7   764

 trainFcn = 'trainbr';  % Scaled conjugate gradient backpropagation.

% Create a Pattern Recognition Network
hiddenLayerSize = 100;
net = patternnet(hiddenLayerSize, trainFcn);

% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 60/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 20/100;

% Train the Network
[net,tr] = train(net,x,t);

>> tr

tr = 

  struct with fields:
    
   divideFcn: 'dividerand'
  divideMode: 'sample'
 divideParam: [1×1 struct]
    trainInd: [1×611 double]
      valInd: []
     testInd: [1×153 double]
    
   best_perf: 0.0015
  best_vperf: NaN
  best_tperf: 0.0942

I'm using simple demo code on custom input data.
I get weird problem, where my validation set is empty and only performance on test set is monitored (perhaps is the second problem consequence of the first one).

>> size(x)

ans =

    25   764

>> size(t)

ans =

     7   764

 trainFcn = 'trainbr';  % Scaled conjugate gradient backpropagation.

% Create a Pattern Recognition Network
hiddenLayerSize = 100;
net = patternnet(hiddenLayerSize, trainFcn);

% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 60/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 20/100;

% Train the Network
[net,tr] = train(net,x,t);

>> tr

tr = 

  struct with fields:
    
   divideFcn: 'dividerand'
  divideMode: 'sample'
 divideParam: [1×1 struct]
    trainInd: [1×611 double]
      valInd: []
     testInd: [1×153 double]
    
   best_perf: 0.0015
  best_vperf: NaN
  best_tperf: 0.0942

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青春有你 2025-01-26 22:45:31

似乎它依赖于方法。其他方法(scg)具有非空验证......

It seems that it is method dependent.. Other method (scg) has validation non-empty...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文