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

11 次查看(过去 30 天)
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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by