Neural Network retrieve test dataset to plot

I am wanting to retrieve the data in the 'test' plot from training so that I can plot the data myself in a different format.
I can access the training, validation, test indices using [tr] but how do I find the network outputs for these to plot against the targets?

 採用された回答

Greg Heath
Greg Heath 2015 年 1 月 28 日

1 投票

From either
[ net tr y e ] = train( net, x, t );
% or
% [ net tr ] = train( net, x, t );
% y = net(x);
% e = t - y ;
ttrn = t(:,tr.trainInd);
ytrn = y(:,tr.trainInd);
and similarly for yval and ytst.
Hope this helps.
Thank you for formally accepting my answer
Greg

4 件のコメント

Lucy
Lucy 2015 年 1 月 28 日
Thanks Greg, this looks promising.
However, I am slightly confused - y is the size of the trainInd not the full training set. Therefore the testInd are outside the range of y.
Lucy
Greg Heath
Greg Heath 2015 年 1 月 28 日
No.
Similarly for yval and ytst.
Lucy
Lucy 2015 年 1 月 29 日
I am interested in the test component of the training set. y appears to contains the output for train, but for val and test. How can I access the test output? i.e. ytst=y(:,tr.testInd); Index exceeds matrix dimensions Thanks
Greg Heath
Greg Heath 2015 年 1 月 29 日
No. if train(net,x,t) contains all x and t, then y contains ytrn, yval and ytst.
Obviously you are doing something wrong. Please post code and results of using one of MATLAB's example data sets in
help nndatasets
doc nndatasets.
HTH.
GGreg

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2015 年 1 月 28 日

コメント済み:

2015 年 1 月 29 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by