Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Last active Sep 24, 2019
Embed
What would you like to do?
class Sigmoid(Function):
def forward(self, X):
return 1/(1 + np.exp(-X))
def local_grad(self, X):
s = 1/(1 + np.exp(-X))
grads = {'X': s * (1 - s)}
return grads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment