Want to use something like dividerand and then apply the indices over and over with various fitnet & train combinations?
2 次查看(过去 30 天)
显示 更早的评论
For example in the following code after running dividerand I can see the indices for the train, validation and test values.
However as soon as it sees trainbr, it eliminates the validation indices, which I don't want it to do so. When I create a new fitnet using trainlm it is no longer using the same train, validation and test values.
Any ideas?
x = -1:0.05:1;
t = sin(2*pi*x) + 0.1*randn(size(x));
[trainT,valT,testT] = dividerand(length(t),80/100,10/100,10/100); % maybe make eval percentage 0 if trainbr, but not necessary since:
% "Validation stops are disabled by default (max_fail = 0) so that
% training can continue until an optimial combination of errors and
% weights are found"?
net = fitnet([20,20],'trainbr'); % [20,10] means 2 hidden layers 1st w size 20 & 2nd w size 10
% help(net.trainFcn) to see the default settings
% disable fitnet from using mapminmax if using my scaling algo
[net,tr] = train(net,x,t); % trains the NN and tr contains all kinds of metadata
view(net) % sb after train
y = net(x);
perf = perform(net,y,t)
%doing fitnet then train again to see if still using same indices for
%trainT,valT, testT in the train function
net = fitnet([20,10],'trainlm'); % [20,10] means 2 hidden layers 1st w size 20 & 2nd w size 10
% help(net.trainFcn) to see the default settings
% disable fitnet from using mapminmax if using my scaling algo
[net,tr] = train(net,x,t); % trains the NN and tr contains all kinds of metadata
view(net) % sb after train
y = net(x);
perf = perform(net,y,t)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modeling and Prediction with NARX and Time-Delay Networks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!