Large gap between training and validation accuracy

17 views (last 30 days)
I am working on gesture video classification. I have gone through the MATLAB tutorial Using this I tried the similar way on the dataset I am using. The piece of code is
numFeatures = (size(TC{1},1));
numClasses = numel(categories(Trainlbl1));
layers = [
miniBatchSize = 32;
numObservations = numel(TC);
numIterationsPerEpoch = floor(numObservations / miniBatchSize);
options = trainingOptions('adam', ...
'MiniBatchSize',miniBatchSize, ...
'InitialLearnRate',0.0001, ...
'L2Regularization', 1.0000e-04, ...
'GradientThreshold',2, ...
'Shuffle','never', ...
'ValidationData',{VC,Validlbl1'}, ...
'ValidationFrequency',numIterationsPerEpoch, ...
'Plots','training-progress', ...
[netLSTM,info] = trainNetwork(TC,lt,layers,options);
YPred = classify(netLSTM,VC,'MiniBatchSize',miniBatchSize);
YValidation = Validlbl1';
accuracy = mean(YPred == YValidation);
where TC is the cell containing the training sequences of size 35516-by-1. Each cell is of size 1024-by-32. Trainlbl1 is the labels of training dataset and VC is the cell containing the training sequences of size 5784-by-1 and each cell is of size 1024-by-32. After running the code I am not getting accuracy more than 10%. I am not getting where the problem lies. Also, I am not getting how to tune the hyparameters. I am attaching here the plot of training progress. There is a large gap between training accuracy and validation accuracy. How to reduce that gap or how to avoid that overfitting?
In case of any query, feel free to comment.

Answers (0)


Find more on Deep Learning with Time Series and Sequence Data in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!