neural.py 523 B

12345678910111213141516171819
  1. # Hold the network attributes
  2. import numpy as np
  3. class Network():
  4. def __init__(self, activationFunction, activationDerivative):
  5. self.inputLength = 784
  6. self.hiddenLength = 30
  7. self.outputLength = 10
  8. self.activationFunction = activationFunction
  9. self.activationDerivative = activationDerivative
  10. self.layer1 = np.zeros((self.hiddenLength, self.inputLength))
  11. self.bias1 = np.zeros(self.hiddenLength)
  12. self.layer2 = np.zeros((self.outputLength, self.hiddenLength))
  13. self.bias2 = np.zeros(self.outputLength)