How to record the results of neural network training

4 Ansichten (letzte 30 Tage)
lech king
lech king am 12 Aug. 2021
Beantwortet: Rushil am 4 Apr. 2025
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

Antworten (1)

Rushil
Rushil am 4 Apr. 2025
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

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by