-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting_model.m
More file actions
13 lines (13 loc) · 1.13 KB
/
testing_model.m
File metadata and controls
13 lines (13 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
%%Training model:
clc
clear all
close all
warning off
g=alexnet; %calling alextnet deep learning tool to train the network
layers=g.Layers; %extracting the layers
layers(23)=fullyConnectedLayer(2); %keeping fully connected layers as 2
layers(25)=classificationLayer; %classifying 2 different layers
allImages=imageDatastore('data storage','IncludeSubfolders',true, 'LabelSource','foldernames'); %storing the data using imgDatastore
opts=trainingOptions('sgdm','InitialLearnRate',0.001,'MaxEpochs',20,'MiniBatchSize',64); %updating learning parameters
myNet1=trainNetwork(allImages,layers,opts); %training the network using trainNetwork
save myNet1; %saving the network