Created
April 10, 2020 08:04
-
-
Save Muhammad-Yunus/04fbdc6fd3f106d9b7e1f4aab6de382a 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
for i in range(NUM_ITER): | |
y_pred = np.dot(x, W) + b | |
#activation sigmoid | |
y_pred = 1.0 / (1.0 + np.exp(-y_pred)) | |
err = y - y_pred | |
delta_W = learning_rate * np.dot(np.transpose(x) , err) | |
delta_b = learning_rate * np.sum(err) | |
W = W + delta_W | |
b = b + delta_b | |
print ("Iterasi ke-" + str(i), err, W, b, "Error :" + str(np.abs(np.sum(err) / np.sum(y)))) | |
if np.abs(np.sum(err) / np.sum(y)) <= 0.1: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment