I am working on a model which contains positive and negative outputs. Can i use ReLu for the problem? Problem:Its non-linear regression where my input is image-pixels while output is some scaler value.


You can use it in any layer except the last one. Positive output values from the intermediate layers can get converted to negative values using linear transformations in the last layer. It could be achieved, for example, by multiplying every positive value by -1.

| cite | improve this answer | |
  • $\begingroup$ Thanks and what should be the good activation for output layer. As sigmoid will reduce the performance for sure and i am not sure about tanh. $\endgroup$ – A R. Jan 7 at 10:05
  • $\begingroup$ It depends on your problem. For example, if you're trying to predict temperature measured in celsius than linear activation might be a good choice since you want to predict positive and negative values. Tanh and Sigmoid might be a good choice for cases when you have your values in the range between [-1, 1] and [0, 1] respectively. Or maybe for cases when maximum and minimum values are known and you can scale your target variables to one of these ranges. $\endgroup$ – itdxer Jan 7 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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