How to record the results of neural network training

1 visualización (últimos 30 días)
lech king
lech king el 12 de Ag. de 2021
Respondida: Rushil el 4 de Abr. de 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

Respuestas (1)

Rushil
Rushil el 4 de Abr. de 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

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by