title: Sigmoid Function in Numpy
body: <p>For fast computations, I have to implement my sigmoid function in Numpy this is the code below </p>
  
  <pre><code>   def sigmoid(Z):
      """
      Implements the sigmoid activation in bumpy
  
      Arguments:
      Z -- numpy array of any shape
  
      Returns:
      A -- output of sigmoid(z), same shape as Z
      cache -- returns Z, useful during backpropagation
      """
  
      cache=Z
  
      print(type(Z))
      print(Z)
      A=1/(1+(np.exp((-Z))))
  
      return A, cache
  </code></pre>
  
  <p>Also some relevant information:</p>
  
  <pre><code>  Z=(np.matmul(W,A)+b)
  </code></pre>
  
  <p>and the type of Z is:</p>
  
  <pre><code>  &lt;class 'numpy.ndarray'&gt;
  </code></pre>
  
  <p>Sadly I am getting a: "bad operand type for unary -: 'tuple' "
  I have tried to work around this problem without any luck.I appreciate any suggestions.
  Best </p>