File size: 449 Bytes
273f88a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function trainedNet = EEGNetTraining(data, labels, layers)
   
    options = trainingOptions('sgdm', ...
    'InitialLearnRate',0.001, ...
    'MaxEpochs',100, ...
    'MiniBatchSize',1, ...
    'Shuffle','every-epoch', ...
    'Verbose',false, ...
    'Plots','none');
    
%     data = dlarray(data, 'SSCB');
    data = permute(data, [2 3 4 1]);
    labels = categorical(labels)';
    trainedNet = trainNetwork(data, labels, layers, options);

end