title: Implementation of softmax function returns nan for high inputs
body: <p><img src="https://i.stack.imgur.com/GsDuL.png" alt="enter image description here"></p>
  
  <p>I am trying to implement softmax at the end of cnn, The output I got is nan and zeros. I am giving high input values to softmax around 10-20k I'm giving an array of <code>X=[2345,3456,6543,-6789,-9234]</code></p>
  
  <p>My function is </p>
  
  <pre><code>def softmax (X):
      B=np.exp(X)
      C=np.sum(np.exp(X))
      return B/C
  </code></pre>
  
  <p>I am getting error of <code>true divide and run time error</code></p>
  
  <pre><code>C:\Anaconda\envs\deep_learning\lib\site-packages\ipykernel_launcher.py:4: RuntimeWarning: invalid value encountered in true_divide
    after removing the cwd from sys.path.
  </code></pre>