Skip to content

Instantly share code, notes, and snippets.

@curiousily
Created April 1, 2019 20:24
Show Gist options
  • Save curiousily/635e0eb0d62b9f5ec05d75d31fdfe241 to your computer and use it in GitHub Desktop.
Save curiousily/635e0eb0d62b9f5ec05d75d31fdfe241 to your computer and use it in GitHub Desktop.
def loss(h, y):
sq_error = (h - y)**2
n = len(y)
return 1.0 / (2*n) * sq_error.sum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment