Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Logreg
import hnumpy as hnp
import numpy as np
weights = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
bias = np.array([0.1])
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def func(x):
return sigmoid(np.dot(x, weights) + bias)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment