Multilayer neural network only slightly better than linear neural network
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have made a linear neural network with a hidden layer and a multilayer non-linear neural network with 3 hidden layers. Both of them get as input a matrix of this kind:
1.7300 1.9500 2.3800 1.4400 5.0000 4.7500 2.1000 3.2000 2.2500 1.3000
3.4000 3.2000 3.3000 3.7500 3.5000 3.4000 3.2000 3.4000 3.2500 5.2500
5.0000 3.0000 2.0000 7.0000 1.0000 1.0000 3.0000 2.0000 2.0000 9.0000
and have this kind of matrix as target:
0 0 0 1 0 0 0 0 1 1
1 1 0 0 0 1 1 0 0 0
0 0 1 0 1 0 0 1 0 0
The code for the first neural network is the following
function [trainClassificationRatio, testClassificationRatio] = feedForwardLinearNet(xTrain,tTrain, xTest,tTest)
rng ('default');
net = feedforwardnet(3);
net.layers{1}.transferFcn = 'purelin';
[net, tr, Ytrain] = train(net,xTrain,tTrain);
trueTrainClass = vec2ind(tTrain);
assignedTrainClass = vec2ind(Ytrain);
trainError = assignedTrainClass ~= trueTrainClass;
trainNumError = sum(trainError);
trainPctError = 100 * trainNumError / size(xTrain,2);
trainClassificationRatio = 100 - trainPctError;
Ytest = net(xTest);
trueTestClass = vec2ind(tTest);
assignedTestClass = vec2ind(Ytest);
testError = assignedTestClass ~= trueTestClass;
testNumError = sum(testError);
testPctError = 100 * testNumError / size(xTest,2);
testClassificationRatio = 100 - testPctError;
end
The code for the second non-linear multilayer neural network differs from the first only in this part:
net = feedforwardnet([6 6 6]);
net.layers{3}.transferFcn = 'softmax';
I have also used patternnet either with the default settings or with setting the output transfer function to logsig with no improvement. Why the accuracy of the 2 different NN's is almost the same?
1 comentario
Aditya Patil
el 22 de Sept. de 2020
Neural network accuracy can be affected by many factors. Can you elaborate more on what the accuracies are currently, so that better suggestions could be provided? Also, any information on the data size and features would be helpful.
Respuestas (0)
Ver también
Categorías
Más información sobre Deep Learning Toolbox 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!