Azzera filtri
Azzera filtri

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 visualizzazione (ultimi 30 giorni)
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)

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by