How can i use CNN?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a 3D feature set [10x2000x9, 10x2000x9,10x2000x9......................10x2000x9] and corrosponding ground truth in 4 class like [0,1,2,3]. Means for each 10x2000x9 their will be a ground truth from 0 to 3. How can i use CNN for this to classify in multiclass?
1 comentario
KSSV
el 22 de Mzo. de 2021
You may go through the examples and pick the code and extend to your case.
Respuestas (1)
Srivardhan Gadila
el 28 de Mzo. de 2021
You can refer to Create Simple Deep Learning Network for Classification, Training a Model from Scratch, Get Started with Deep Learning Toolbox & Deep Learning Toolbox. Also the following code might give you some idea to get started quickly:
inputSize = [10 2000 9];
numSamples = 128;
numClasses = 4;
%% Generate random data for training the network.
trainData = randn([inputSize numSamples]);
trainLabels = categorical(randi([0 numClasses-1], numSamples,1));
%% Create a network.
layers = [
imageInputLayer(inputSize,'Name','input')
convolution2dLayer(3,16,'Padding','same','Name','conv_1')
batchNormalizationLayer('Name','BN_1')
reluLayer('Name','relu_1')
fullyConnectedLayer(10,'Name','fc1')
fullyConnectedLayer(numClasses,'Name','fc2')
softmaxLayer('Name','softmax')
classificationLayer('Name','classOutput')];
lgraph = layerGraph(layers);
%% Define training options.
options = trainingOptions('adam', ...
'InitialLearnRate',0.005, ...
'LearnRateSchedule','piecewise',...
'MaxEpochs',100, ...
'MiniBatchSize',128, ...
'Verbose',1, ...
'Plots','training-progress');
%% Train the network.
net = trainNetwork(trainData,trainLabels,layers,options);
0 comentarios
Ver también
Categorías
Más información sobre Recognition, Object Detection, and Semantic Segmentation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!