Guest User

Untitled

a guest
Jan 16th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class my_NN(object):
  2. def __init__(self):
  3. self.input = 4 # feature numbers
  4. self.output = 1 # class number
  5. self.hidden_units = 6 # single layer
  6.  
  7. # initialize matrix of weights;
  8. np.random.seed(1)
  9. # weight1: input -> hidden layer
  10. self.w1 = np.random.randn(self.input, self.hidden_units) # 4*6 matrix
  11. # weight2: hidden layer -> output
  12. self.w2 = np.random.randn(self.hidden_units, self.output) # 6*1 matrix
Add Comment
Please, Sign In to add comment