def negation_func(bit): data = [1, bit] theta = array([10, -20]) return loc_reg.predict(data, theta)
def or_func(data): n, m = data.shape data = hstack((ones((n, 1)), data)) theta = array([-10, 20, 20]) return loc_reg.predict(data, theta)