Commit 12d020ad authored by SHREYANSH JAIN's avatar SHREYANSH JAIN

final code

parent d768e8d6
......@@ -106,4 +106,4 @@ def loadMnist():
if __name__ == "__main__":
np.random.seed(7)
taskXor()
# taskMnist()
taskMnist()
......@@ -236,8 +236,19 @@ class FullyConnectedLayer:
else:
print("ERROR: Incorrect activation specified: " + self.activation)
exit()
# print(self.weightsGrad[5:10,:])
# print(self.weights[5:10,:])
self.weightsGrad = (activation_prev.T @ inp_delta)/delta.shape[0]
self.biasesGrad = np.average(inp_delta,axis=0)
# if self.weightsGrad.shape[0] == 784:
# print(self.weightsGrad.shape,self.biasesGrad.shape)
# print(self.weightsGrad[5:6,:],self.biasesGrad)
# print(activation_prev.shape)
# print(activation_prev[5:6,:])
# print(inp_delta.shape)
# print(inp_delta[5:6,:])
new_delta = inp_delta @ self.weights.T
return new_delta
###############################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment