- Use the view function to check the structure of your neural net. You can access the weight and bias values directly. Using the same notation that you used above, the input weights can be found via net.IW. Likewise, the layer weights and biases can be found via net.LW and net.b, respectively. If you understand the structure of your neural net, reconstruction should hopefully be fairly straightforward!
- Using the gensim command, you can create a Simulink block diagram of the neural network model. Since this is a most visual method of inspecting your trained network, the Simulink model might give you a more intuitive feel for how your model works.
how to drive out an equation from the trained neural network to use as an objective function for genetic algorithm?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amir Ghiami
el 14 de Oct. de 2013
Comentada: Oladipo Thompson
el 4 de Dic. de 2013
Dear all,
I have some experimental data, by use of neural network I am trying to find a non-linear relation between my variants. I did that by applying below MATLAB codes.
p=dlmread('input.txt','',[0 0 3 11]);
t=dlmread('UTS.txt','',[0 0 0 11]);
net=newff(minmax(p),[5,7,1],{'purelin','logsig','purelin'},'traingd');
net.trainParam.show = 50;
net.trainParam.lr = 0.05;
net.trainParam.epochs = 10000;
net.trainParam.goal = 1e-4;
net.trainParam.mc = 0.5;
[net,tr]=train(net,p,t);
a=sim(net,p);
Now, I want to drive out the equation which correlates the inputs to the outputs so that I can use it as an objective function in order to be optimized by Genetic Algorithm. Once, I decided to use Wight matrixes and biases to obtain the function but I even could not find the right codes to obtain the weights and biases and also don't know the exact relation between the wights, biases, transfer functions, inputs and outputs.
I am getting confused.
0 comentarios
Respuesta aceptada
Jonathan LeSage
el 14 de Oct. de 2013
You have a couple of options to acquire the underlying structure for further use, once you have trained your neural network:
Good luck!
4 comentarios
Oladipo Thompson
el 4 de Dic. de 2013
Dear Jonathan, I am using matlab 2012b and it does not have the "genFunction" command. Is there any other command I can use to perform this same function of obtaining a function from a trained network to perform other tasks.
Thanks in anticipation. Regards, Dipo
Más respuestas (1)
Greg Heath
el 17 de Oct. de 2013
The design is unnecessarily complicated
1. You are using the double obsolete design function, newff. The most recent version of newff was made obsolete 3 years ago and used the simple syntax
net = newff(input,target,numhidden);
Are you able to use this version?
help newff
2. Are you able to use the latest regression/curvefitting function fitnet?
help fitnet
3. One hidden layer is sufficient (universal approximator).
4. Purelin hidden layers are useless.
5. For easier and faster learning, centralize inputs (e.g., zscore, mapstd or mapminmax)and use tansig hidden layers
6. Use as many defaults as possible.
7. For the default tansig/purelin configuration
output = repmat(b2,1,N) + LW2*tanh(repmat(b1,1,N)+LW1*input);
Hope this helps.
Thank you for formally accepting my answer
Greg
0 comentarios
Ver también
Categorías
Más información sobre Sequence and Numeric Feature Data Workflows 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!