<> data format

Save the data in the sample column cell My line
Label as a column categorical type
Network settings are classified as last, Return to sequence

<> code
% Data parameters inputSize = 784; numClasses = 10; % structure layers = [ ...
sequenceInputLayer(inputSize) lstmLayer(125,'OutputMode','sequence')
lstmLayer(125,'OutputMode','last') fullyConnectedLayer(numClasses)
softmaxLayer() classificationLayer() ]; % parameter options = trainingOptions('adam',
... 'MaxEpochs',8000, ... 'MiniBatchSize',7000, ... 'Verbose',true, ...
'InitialLearnRate',0.02, ... 'L2Regularization',0.0010, ...
'LearnRateDropPeriod',4, ... 'LearnRateDropFactor',0.04, ...
'plots','training-progress'); % train net =
trainNetwork(TrainData,TrainLabels,layers,options); % test YPred =
classify(net,TestData, ... 'MiniBatchSize',7000, ...
'SequenceLength','longest'); % Accuracy acc = sum(YPred ==
TestLabels)./numel(TestLabels)

Technology