Saving multiple runs within a neural network

3 次查看(过去 30 天)
Hello, I'm using a neural network to analyze a time series dataset with roughly 15,000 lines of data. I'm running abundance data against environmental variables looking for correlations. I'm running the network 100 times for each different parameter to get accurate results. The issue i'm having is that the network is only outputting the results from the last run and I'd like to save them all.
I've incorporated the following into the end of my network to try and save the outputs, targets, p-values, and r2 for each run
for k=1:100
p=1;
q= 15843;
outputmat(p:q,1) = targets;
outputmat(p:q,2) = outputs;
but it is still just saving the last batch of results. Any clue how to get it to save all the data i'm looking for?

回答(1 个)

Vimal Rathod
Vimal Rathod 2020-1-30
编辑:Vimal Rathod 2020-1-30
It seems the outputmat does not depend on the k value of your "for loop" and thus it is updating the same values in the loop.
You could use
for k = 1:100
p = 1;
q = 15000;
outputmat(p:q , 2*k-1) = targets;
outputmat(p:q , 2*k) = outputs;
end
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by