title: How to restrict the output of Neural Network to be positive in Python, Keras
body: <p>I use package Keras:</p>
  
  <pre><code>from keras.models import Sequential
  from keras.layers import Dense, Activation
  
  model = Sequential([
  Dense(100, input_shape=(52,)),
  Activation('relu'),
  Dense(40),
  Activation('softmax'),
  Dense(1),
  Activation('tanh')
  ])
  
   model.compile(optimizer='sgd',
            loss='mean_absolute_error')
   model.fit(train_x2, train_y, epochs=200, batch_size=52)
  </code></pre>
  
  <p>How can I adjust it such that it considers the output should be zero? I can change it at the end, but I want it to consider this fact while learning.</p>