Body: <p>I am trying to make a neural network which takes in 0 and 1 as it's input and should give me output ranging from [-20,-1].I am using three layers with sigmoid as the activation function .How should I design my output layer?Any sort of code snippet from your side will be helpful .I am using tensorflow.Please help me out with the same</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-16T11:36:38.433Z
Comments.Text: You can use $tanh$ function as the activation for the output and then the result would be $y = 9.5 \cdot tanh(x) - 10.5$. That way when $tanh$ gives output $1$ , $y$ would be $-1$ and when $tanh$ gives $-1$ output would be $-20$ and anything  in $[-1, 1]$ would be in $[-20, -1]$.
Comments.UserDisplayName: Brale
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-16T12:00:22.177Z
Comments.Text: Thanks.:)..I just tried adding it but still my network is not learning at all.
Comments.UserDisplayName: Aggraj Gupta
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-16T13:05:07.443Z
Comments.Text: Try using MinMaxScaler to normalize target values. And then you can use the inverse transform of the output after training.
Comments.UserDisplayName: serali
Tags: <neural-networks><deep-learning><tensorflow>
Title: How should I make output layer of my neural network so that I can get outputs ranging from [-20,-1]
UserDisplayName: Aggraj Gupta
ThreadText: # How should I make output layer of my neural network so that I can get outputs ranging from [-20,-1]
  
  (Asked by: username_0 on 2019-11-16)
  
  I am trying to make a neural network which takes in 0 and 1 as it's input and should give me output ranging from [-20,-1].I am using three layers with sigmoid as the activation function .How should I design my output layer?Any sort of code snippet from your side will be helpful .I am using tensorflow.Please help me out with the same
  
  **Tags:** neural-networks, deep-learning, tensorflow
  
  > **Comments:**
  > **username_1**: You can use $tanh$ function as the activation for the output and then the result would be $y = 9.5 \cdot tanh(x) - 10.5$. That way when $tanh$ gives output $1$ , $y$ would be $-1$ and when $tanh$ gives $-1$ output would be $-20$ and anything  in $[-1, 1]$ would be in $[-20, -1]$.  
  > **username_0**: Thanks.:)..I just tried adding it but still my network is not learning at all.  
  > **username_2**: Try using MinMaxScaler to normalize target values. And then you can use the inverse transform of the output after training.  
  
  ---
  
  ## 0 answers
  
  