Answers.Body: <p>For this particular classification problem, I would recommend you using a softmax function whose output range is [0,1].<br>
  The sum of all outputs should be 1, so an advantage of using a softmax function is that you get a percentage of how confident the network is in this classification.</p>
  
  <p>Side note: As DuttaA has commented, cross entropy loss is a better loss function than the quadratic mean squared error.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-08T20:05:36.407Z
Answers.LastActivityDate: 2019-03-08T20:05:36.407Z
Answers.UserDisplayName: Luca Jung
Answers.Body: <p>your targets should be in the same range as your output functions other wise your loss function wont be accurate, with supervised learning your trying to reduce the loss of your output against your targets so in this case your targets should be the true/optimal probability distribution for that set of input data. Im from the midwest so obligatory "cant compare apples to oranges" here ;)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-05T21:43:34.387Z
Answers.LastActivityDate: 2019-08-05T21:50:32.407Z
Answers.LastEditDate: 2019-08-05T21:50:32.407Z
Answers.UserDisplayName: nickw
Body: <p>I am working on a MLP neural networks, using supervised learning (2 classes and multi-class classification problems). For the hidden layers, I am using <span class="math-container">$\tanh$</span> (which produces an output in the range <span class="math-container">$[-1, 1]$</span>) and for the output layer a softmax (which gives the probability distribution between <span class="math-container">$0$</span> and <span class="math-container">$1$</span>). As I am working with supervised learning, should be my targets output between 0 and 1, or <span class="math-container">$-1$</span> and <span class="math-container">$1$</span> (because of the <span class="math-container">$\tanh$</span> function), or it does not matter?</p>
  
  <p>The loss function is quadratic (MSE).</p>
  
Tags: <neural-networks><classification><activation-functions><supervised-learning>
Title: What should the range of the output layer be when performing classification?
UserDisplayName: LVoltz
ThreadText: # What should the range of the output layer be when performing classification?
  
  (Asked by: username_0 on 2019-03-08)
  
  I am working on a MLP neural networks, using supervised learning (2 classes and multi-class classification problems). For the hidden layers, I am using $\tanh$ (which produces an output in the range $[-1, 1]$) and for the output layer a softmax (which gives the probability distribution between $0$ and $1$). As I am working with supervised learning, should be my targets output between 0 and 1, or $-1$ and $1$ (because of the $\tanh$ function), or it does not matter?
  
  The loss function is quadratic (MSE).
  
  **Tags:** neural-networks, classification, activation-functions, supervised-learning
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-03-08. Score: 1
  
  For this particular classification problem, I would recommend you using a softmax function whose output range is [0,1].  
  The sum of all outputs should be 1, so an advantage of using a softmax function is that you get a percentage of how confident the network is in this classification.
  
  Side note: As DuttaA has commented, cross entropy loss is a better loss function than the quadratic mean squared error.
  
  
  ---
  
  ### Answer by username_2 on 2019-08-05. Score: 0
  
  your targets should be in the same range as your output functions other wise your loss function wont be accurate, with supervised learning your trying to reduce the loss of your output against your targets so in this case your targets should be the true/optimal probability distribution for that set of input data. Im from the midwest so obligatory "cant compare apples to oranges" here ;)
  
  
  ---
  
  