Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Last active September 24, 2019 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosmic-cortex/a4ab327269c5a7e5886edea82c2d1576 to your computer and use it in GitHub Desktop.
Save cosmic-cortex/a4ab327269c5a7e5886edea82c2d1576 to your computer and use it in GitHub Desktop.
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