Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Created January 19, 2024 12:51
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/3d9b1a287c355413328f7f673250cc8f to your computer and use it in GitHub Desktop.
Save cosmic-cortex/3d9b1a287c355413328f7f673250cc8f to your computer and use it in GitHub Desktop.
import numpy as np
class Sigmoid:
def __call__(self, x):
return 1 / (1 + np.exp(-x))
def grad(self, x):
return self(x) * (1 - self(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment