<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>

CC BY-SA 4.0
2019-11-16T11:36:38.433Z
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]$.
Brale
CC BY-SA 4.0
2019-11-16T12:00:22.177Z
Thanks.:)..I just tried adding it but still my network is not learning at all.
Aggraj Gupta
CC BY-SA 4.0
2019-11-16T13:05:07.443Z
Try using MinMaxScaler to normalize target values. And then you can use the inverse transform of the output after training.
serali
<neural-networks><deep-learning><tensorflow>
How should I make output layer of my neural network so that I can get outputs ranging from [-20,-1]
Aggraj Gupta
# 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

