How to save training plot in batch mode (deep learning toolbox)

조회 수: 18(최근 30일)
James Latshaw
James Latshaw 2020년 11월 14일
댓글: Théo 2021년 5월 10일
Hi,
In regards to the deep learning toolbox, is there a way to save the training plots to a .mat, .jpg, or .fig?
My issue is that I am running my matlab scripts on a server in batch mode and won't actually see this plot (everything is over the terminal, run with batch files). However I can save data to a .mat file so that I can view it later. Is it possible to save the plot to as a file? Or, maybe there is a better way to do this?
Similar question, is there a way to re-generate the training progress plot after I have finished training the network if I have the net or DAGNetwork file?
Thank you so much for helping me out with this :)

답변(1개)

James Latshaw
James Latshaw 2020년 11월 17일
However, this process can cause output errors if you have very large networks (using lots of memory) because you are trying to save a rich in data plot to memory. I found a work around as plotting the last value of training. So, this isn't a nice plot, but at least it give me some metric to evaluate the RMSE value (or accuracy):
function stop=savetrainingplot(info)
stop=false; %prevents this function from ending trainNetwork prematurely
if info.State=='done' %check if all iterations have completed
% if true
%saveas(gcf,'filename.png') % save figure as .png, you can change this
file_name = ['big3_performance_' num2str(floor(now*100000)) '.mat'];
% to_save_fig = findall(groot, 'Type', 'Figure');
% to_save_fig_last = to_save_fig(end);
%saveas(figure(to_save_fig(end)), file_name)
performance = [info.Iteration info.Epoch info.ValidationRMSE];
save(file_name, 'performance', '-v7.3')
end
end
I hope that this helps someone :)
  댓글 수: 1
Théo
Théo 2021년 5월 10일
Hello,
After struggling for a few hours, I found a workaround :
savefig(currentfig, yourfig.fig, 'compact')
The display is a bit affected but still fine.
I found this parameter scrolling down the savefig help document.
Best,
Théo

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by