code: def compute_cost(A2, Y):
      
  
      m = Y.shape[1]  # number of example
  
      # Compute the cross-entropy cost
      logprobs = np.multiply(np.log(A2), Y) + np.multiply(np.log(1 - A2), (1 - Y))
      cost = -np.sum(logprobs) / m
  
      cost = np.squeeze(cost)  # makes sure cost is the dimension we expect.
      # E.g., turns [[17]] into 17
  
      assert (isinstance(cost, float))
  
      return cost
docs: Computes the cross-entropy cost given in equation (13)
  
      Arguments:
      A2 -- The sigmoid output of the second activation, of shape (1, number of examples)
      Y -- "true" labels vector of shape (1, number of examples)
      parameters -- python dictionary containing your parameters W1, b1, W2 and b2
  
      Returns:
      cost -- cross-entropy cost given equation (13)