Skip to content

Instantly share code, notes, and snippets.

@malaikannan
Created September 6, 2016 21:43
Show Gist options
  • Save malaikannan/1b09fb8c64f25ca8d57df325d3aa28d6 to your computer and use it in GitHub Desktop.
Save malaikannan/1b09fb8c64f25ca8d57df325d3aa28d6 to your computer and use it in GitHub Desktop.
import numpy as np
#sigmoid activation function
# This can be replaced by other activation function like RELU, Tanh etc.
def sigmoid(x,derivative=False):
if(derivative==True):
return x*(1-x)
return 1/(1+np.exp(-x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment