%     net = shufflenet ;
%     deepNetworkDesigner
    
    imds = imageDatastore('D:\datasets\kvasir\dataset', ...
        'IncludeSubfolders',true, ...
        'LabelSource','foldernames');
    [imdsTrain,imdsValidation] = splitEachLabel(imds,0.70);
    
    augimdsTrain = augmentedImageDatastore([224 224],imdsTrain);
    augimdsValidation = augmentedImageDatastore([224 224],imdsValidation);

    options = trainingOptions('sgdm', ...
        'MiniBatchSize',8, ...
        'MaxEpochs',10, ...
        'InitialLearnRate',1e-4, ...
        'Shuffle','every-epoch', ...
        'ValidationData',augimdsValidation, ...
        'ValidationFrequency',18, ...
        'Verbose',true, ...
        'Plots','training-progress');


    [net] = trainNetwork(augimdsTrain,lgraph_1,options);
    [YPred, probs] = classify(net,augimdsValidation);
    accuracy = mean(YPred == imdsValidation.Labels)
     figure('Units' , 'normalized' , 'Position' , [0.2 0.2 0.4 0.4]);
     cm = confusionchart(imdsValidation.Labels,YPred);
    cm.Title='Confusion matrix ...';
 
