2
$\begingroup$

I want to predict the labels of images using a neural network. The labels all lie in the range [-1,1] (Ratio scaled). Values with an absolute value greater than one are meaningless and do not occur in the data.

How do I design the final layer? What loss function should I use?

My approach is a "tanh" activation, to squeeze the output into [-1,1] and 'MSE' as the loss function. Does that make sense?

$\endgroup$

1 Answer 1

2
$\begingroup$

How do I design the final layer? What loss function should I use?

The final layer should fit to the desired output, in your case oyu should predict a value between: [-1,1]

Here is an overview about the activation functions: https://en.wikipedia.org/wiki/Activation_function

My approach is a "tanh" activation, to squeeze the output into [-1,1], Does that make sense?

tanh is fine for that approach. which is also quite common is: Softsign

$\endgroup$
1
  • $\begingroup$ Thanks. I was asking this also because I have only seen the usage of tanh, sigmoid and so forth to predict probabilities for classification. I thought maybe it is only applicable for this special case. $\endgroup$
    – PascalIv
    Commented Sep 12, 2019 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.