etileyli
Newbie level 5
Hi all!!
I have a problem on implementing a neural network in MATLAB with using addition and multiplication.
I'm trying to implement the network below,
p = [1 3];
t = [2 4];
net = newff(p,t,1);
net = train(net, p,t);
______________________________
after running the code above, I fetch the weights and biases with
input_weights = net.IW;
layer_weights = net.LW;
biases = net.b;
write a function " try_neural" with resulting weights
function [net_out] = try_neural(in_1)
w_1_1 = -1.47057806618821; b_1 = 0.0252873414230115;
L1_out = tansig(in_1*w_1_1 + b_1);
wo_1 = -1.11163638238458; b_o = 0.00535792495355342;
net_out = L1_out*wo_1 + b_o;
then run the line : result = try_neural (1);
I'm getting different results with
result = sim(net,1);
Most probably I'm missing something very basic and simple but I can't figure out the source of error. (I'm using MATLAB 2010b)
Thanks in advance!!
I have a problem on implementing a neural network in MATLAB with using addition and multiplication.
I'm trying to implement the network below,
p = [1 3];
t = [2 4];
net = newff(p,t,1);
net = train(net, p,t);
______________________________
after running the code above, I fetch the weights and biases with
input_weights = net.IW;
layer_weights = net.LW;
biases = net.b;
write a function " try_neural" with resulting weights
function [net_out] = try_neural(in_1)
w_1_1 = -1.47057806618821; b_1 = 0.0252873414230115;
L1_out = tansig(in_1*w_1_1 + b_1);
wo_1 = -1.11163638238458; b_o = 0.00535792495355342;
net_out = L1_out*wo_1 + b_o;
then run the line : result = try_neural (1);
I'm getting different results with
result = sim(net,1);
Most probably I'm missing something very basic and simple but I can't figure out the source of error. (I'm using MATLAB 2010b)
Thanks in advance!!