Created
December 1, 2020 05:11
-
-
Save angadsinghsandhu/d2b295c0663d4767d9cd7068374a017d to your computer and use it in GitHub Desktop.
function that executed forward prop, backprop and loss calculation
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
# training neural net | |
def train(self): | |
# dynamically calculating layers and their respective z | |
for i in range(len(self.input)): | |
self.z0 = self.input[i].reshape([-1, 1]) | |
# forward step | |
output = self.forwardprop() | |
self.y_hat[i] = output | |
# backward step | |
self.backprop(self.y_hat[i], self.y[i]) | |
# loss calculation step | |
self.NN_loss(self.y_hat[i], self.y[i]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment