MLP Activation Function - train vs predict
Hey, so my question was for the developers.
In the docs, it says that training is done using the sigmoid activation function. However, when you use predict it uses y = 1.7159*tanh(2/3 * x).
Can I just have a little clarification please? I don't understand why they train and predict on two different equations. Not only am I just genuinely curious why they are different, but I also need responses to have the range [0,1]. I could normalize the responses, however a better solution is to insure my values in the feature vector are positive (which does not cause a loss in data for my case), this insures the sigmoid responses are between [0,1]. This works for the training side, however not for the testing side since they use different equations and responses will now be between [0,1.7]. I would rather avoid another normalization, if possible.
Thanks for the time! -Tim
"However, when you use predict it uses y = 1.7159*tanh(2/3 * x)." where do you find it ?
In the docs, http://docs.opencv.org/2.4/modules/ml... The sigmoid function is described in the top section, then the hyperbolic tangent is explained to be used under he predict section.
Ok I'm not native english speaking but I understand it is a conditional :
"If you are using the default cvANN_MLP::SIGMOID_SYM activation function with the default parameter values fparam1=0 and fparam2=0 then the function used is y = 1.7159*tanh(2/3 * x), so the output will range from [-1.7159, 1.7159], instead of [0,1]."
In source code (opencv 3.3) it is here to defne activation function and predict it's here. it is the same fucntion .
Now if you want to change activation function use [setActivationFunction](http://docs.op...
Ya you nailed it. Smart thinking diving into the source code. I posted an answer to this.