Hi, i am already sorry for my lack of knowledge. but i am not clear which transfer function is to be used in hidden layers.logsig or tansig?
1 次查看(过去 30 天)
显示 更早的评论
I have this simple program from internet. i guess its simple fitting problem, when i change the transfer function of hidden layer from logsig to tansig it doesnt give any output.infact output is 0; my question is how can i learn which function is to be used in a particular problem for hidden layers.( either tansig or logsig)
close all
clear all
clc
format compact
inputs=[1:6]';
outputs=[-3 2]';
net=network;
net.name='myownneuralnetwork';
net.numinputs=1;
net.numlayers=2;
net.biasconnect=[1;0];
net.inputconnect=[1;0];
net.layerconnect=[0 0;1 0];
net.outputconnect=[0 1];
net.layers{1}.size=5;
net.layers{1}.transferfcn='logsig';
net=configure(net,inputs,outputs);
initial_output = net(inputs)
net.trainfcn='trainlm';
net.performfcn='mse';
net=train(net,inputs,outputs);
final_output = net(inputs)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modeling and Prediction with NARX and Time-Delay Networks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!