I am trying to repeat a study (https://www.sciencedirect.com/science/article/pii/S0957417410011711)
In the study they use two different functions, one for the hidden layer and one for the output. On page 5314 they write "A tangent sigmoid transfer function was selected on the hidden layer. On the other hand, a logistic sigmoid transfer function was used on the output layer."
I'm using package "neuralnet" in R.
In order to have a tangent sigmoid transfer function for the hidden layer I can use the code:
act.fct = 'tanh'
But this will create a problem that I will either A) have the SAME function for the output layer.
Or B) I use linear.output = T
Which gives me a linear output, but not a sigmoid-function. Is there any possible way for me to have another function for the output layer?
Likewise: If I use act.fct = 'logistic'
I will get a logistic sigmoid transfer function throughout the entire network, giving me the correct function for the output layer, but wrong for the hidden layers. Which again only take me halfway.
I have a crude alternative for solving this, a method I'd prefer to not use, It should be possible to use err.fct =
and create a customized error function that uses the linear output and runs it through the desired sigmoid function, for the output. Then I run the output from compute
command through the sigmoid function, separately. But that seems like a hassle and likely I will mess up somewhere along the way. Any proper/better solution for this?