Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Export a neural network trained with MATLAB in other programming languages

Status
Not open for further replies.

Mr.Khiros

Junior Member level 3
Joined
Aug 25, 2013
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
176
I trained a NN with matlab using the following code :
PHP:
  p = [-1 -1 2 2; 0 5 0 5];
    t = [-1 -1 1 1];
    net = newff(p,t,3);
    net = train(net,p,t);
    y = sim(net,p)


Now i'm tring to use the weights & bias calculated by matlab in order to use them to creat a NN in other programming languages, so i used the NN parameters to calculate the output as 'sim function' do :

PHP:
   input = [-1;0]
    y1 = tansig(netsum(dotprod(net.IW{1} , input) , net.b{1}));
    Results = purelin(netsum(dotprod(net.LW{2} ,y1) ,net.b{2})) 
    Y = sim(net,[-1;0])

By this way i do not the same result ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top