title: Avoid Division by Zero in Sigmoid function
body: <p>With : <a href="https://nbviewer.org/github/ImadDabbura/blog-posts/blob/master/notebooks/Coding-Neural-Network-Forwad-Back-Propagation.ipynb" rel="nofollow noreferrer">https://nbviewer.org/github/ImadDabbura/blog-posts/blob/master/notebooks/Coding-Neural-Network-Forwad-Back-Propagation.ipynb</a> as reference
  I am trying to build a Vanila Deep Learning Code.
  I wonder how is division by zero avoided in the sigmoid funtion.</p>
  <pre><code>def sigmoid(Z):
  &quot;&quot;&quot;
  Computes the sigmoid of Z element-wise.
  
  Arguments
  ---------
  Z : array
      output of affine transformation.
  
  Returns
  -------
  A : array
      post activation output.
  Z : array
      output of affine transformation.
  &quot;&quot;&quot;
  A = 1 / (1 + np.exp(-Z))
  
  return A, Z
  </code></pre>