Skip to content

Instantly share code, notes, and snippets.

@akarsh-saxena
Last active May 21, 2020 21:35
Show Gist options
  • Save akarsh-saxena/37090ffe07e2a8e046b425e22aee318f to your computer and use it in GitHub Desktop.
Save akarsh-saxena/37090ffe07e2a8e046b425e22aee318f to your computer and use it in GitHub Desktop.
import numpy as np
def sigmoid(Z):
"""Applies sigmoid function to an array/value
Arguments
---------
Z: float/int/array_like
Original Value
Returns
-------
A: same shape as input
Value after applying sigmoid function
"""
return 1/(1+np.power(np.e, -Z))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment