Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class my_NN(object):
- def __init__(self):
- self.input = 4 # feature numbers
- self.output = 1 # class number
- self.hidden_units = 6 # single layer
- # initialize matrix of weights;
- np.random.seed(1)
- # weight1: input -> hidden layer
- self.w1 = np.random.randn(self.input, self.hidden_units) # 4*6 matrix
- # weight2: hidden layer -> output
- self.w2 = np.random.randn(self.hidden_units, self.output) # 6*1 matrix
Add Comment
Please, Sign In to add comment