How to record the results of neural network training

조회 수: 1 (최근 30일)
lech king
lech king 2021년 8월 12일
답변: Rushil 2025년 4월 4일
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