What's wrong with my neural network?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tony Stark
am 26 Okt. 2022
Beantwortet: Amanjit Dulai
am 27 Okt. 2022
I am trying to debug and figure out why my code is not getting better with each epoch, rather it's getting progressively worse.
I am trying to make it so that I get better training of my training data each time I run the code. What do I do to fix it?
In general, I am aiming for 11 inputs, 1 single layer, and 5 output layers. I'm not sure what's the problem.
Here is the lines of code:
x = rand(75,11);
y = randi(5, 5, 75);
P = x';
T = y;
net = linearlayer;
net = configure(net,P,T);
net.IW{1}(5,11);
net.b{1};
[net,a,e,pf] = adapt(net,P,T);
net = train(net,P,T);
0 Kommentare
Akzeptierte Antwort
Amanjit Dulai
am 27 Okt. 2022
I managed to get this to work by reducing the learning rate:
x = rand(75,11);
y = randi(5, 5, 75);
P = x';
T = y;
% Set the learning rate to 0.001
net = linearlayer(0,0.001);
net = configure(net,P,T);
net.IW{1}(5,11);
net.b{1};
[net,a,e,pf] = adapt(net,P,T);
net = train(net,P,T);
By default, linearlayer does not use backpropagation when training. Instead, it uses the Widrow-Hoff learning rule, so the training might behave differently compared to other networks (fitnet for example uses backpropagation by default).
It's also worth noting that linearlayer is learning only a linear function (that is, a weight and a bias), so it won't fit data with a non-linear relationship very well.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Define Shallow Neural Network Architectures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!