Skip to content

Instantly share code, notes, and snippets.

@angadsinghsandhu
Created December 1, 2020 05:11
Show Gist options
  • Save angadsinghsandhu/d2b295c0663d4767d9cd7068374a017d to your computer and use it in GitHub Desktop.
Save angadsinghsandhu/d2b295c0663d4767d9cd7068374a017d to your computer and use it in GitHub Desktop.
function that executed forward prop, backprop and loss calculation
# 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