Created
March 21, 2020 18:02
-
-
Save tarlanahad/7b23f52904fa86475687fd504901dc83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fit(self): | |
for i in range(self.num_of_epochs): | |
L, dw = self.get_cost_grads(self.X, self.w, self.y) | |
self.w = self.w - self.lr * dw | |
if i % 1000 == 0: | |
print(i, ' | ', L) | |
def predict(self, X): | |
X = np.column_stack((np.ones(len(X)), X)) | |
return np.sign(X @ self.w) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment