How can I design my own fitting neural network?

I want to design a neural network which will be trained to calculate the squra root of 1000 random numbers generated. but I don't want to use fitnet, instead I want to design my own fitting network. can any one tell me the architecture of fitnet used in matlab means how many layers, initializing functions, training functions etc used.

 Respuesta aceptada

Greg Heath
Greg Heath el 1 de Dic. de 2013
Always start with the default configuration.
help fitnet
Combine with the script obtained via the nntool GUI.
You also can find examples by searching
greg fitnet Ntrials
HTH
Thank you for formally accepting my answer.
Greg

1 comentario

saima zia
saima zia el 2 de Dic. de 2013
Editada: saima zia el 2 de Dic. de 2013
Thanks for guiding. I m sending u my code, I have tried to create my own fitnet to train it to calculate square root of number,instead of using the matlab fitnet. the structure of my network is exactly like the fitnet architecture( I analyzed the fitnet architecture by looking at the script and object created of fitnet).plz check it and let me know what mistake I m making cause its not getting trained.
x=rand(1,1000)*150;
t=sqrt(x);
net=network();
net.adaptFcn='adaptwb';
net.numInputs=1;
net.inputs{1}.size=1;
net.numLayers=2;
net.layers{1}.size=10;
net.layers{2}.size=1;
net.inputConnect(1,1)=1;
net.layerConnect(2,1)=1;
net.biasConnect(1)=1;
net.biasConnect(2)=1;
net.biases{1}.learnFcn='learngdm';
net.biases{1}.initFcn='';
net.biases{2}.learnFcn='learngdm';
net.biases{2}.initFcn='';
net.outputConnect(2)=1;
net.layers{1}.transferFcn='tansig';
net.layers{2}.transferFcn = 'purelin';
net.inputweights{1,1}.initFcn='';
net.inputweights{1,1}.learnFcn='learngdm';
net.layerweights{2,1}.initFcn='';
net.layerweights{2,1}.learnFcn='learngdm';
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainFcn = 'trainlm';
net.performFcn = 'mse';
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ... 'plotregression', 'plotfit'};
[net,tr] = train(net,x,t);
outputs = net(x);
test=100;
result = sim(net,test);

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Nov. de 2013

Editada:

el 2 de Dic. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by