How to record the results of neural network training

4 次查看(过去 30 天)
Hi
I have trained a neural network
Which items should I save to record my final results for academic presentation?
I want the number of data I have trained and the type to be clear
These are not listed in trainInfoStruct

回答(1 个)

Rushil
Rushil 2025-4-4
Hello
To present the results after training your neural network, you can consider adding some additional items that describe the data as well as the network properties after training. I assume that the model is already trained, and the data is in the form of a cell array, and the training parameters (like learning rate, epoch, etc.) have been declared. Below is some sample code that illustrates how you could go about this:
save('trainedNetwork.mat', 'net'); % trained network
numTrainingSamples = size(trainingData, 1); % cell array of training data
inputSize = size(trainingData{1}); % each input sample is a cell element
save('trainingDataInfo.mat', 'numTrainingSamples', 'inputSize');
% training parameters
trainingOptions = struct('LearningRate', learningRate, 'BatchSize', batchSize, 'Epochs', epochs);
save('trainingParameters.mat', 'trainingOptions');
% performance metrics
save('trainingPerformance.mat', 'trainInfoStruct');
% test results (in case of classification tasks)
predictions = classify(net, testData); % test dataset
testAccuracy = sum(predictions == testLabels) / numel(testLabels); % labels
% or if you have a function to calculate loss, or use a similar approach
% testLoss = ... (use appropriate loss computation if available)
save('testResults.mat', 'testAccuracy'); % Add 'testLoss' if calculated
% MATLAB environment info
matlabVersion = version;
save('environmentInfo.mat', 'matlabVersion');
Hope it helps you out

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by