MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / HiddenLayer

Class HiddenLayer

ann_class2/batch_norm_tf.py:71–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71class HiddenLayer(object):
72 def __init__(self, M1, M2, f):
73 self.M1 = M1
74 self.M2 = M2
75 self.f = f
76 W = np.random.randn(M1, M2) * np.sqrt(2.0 / M1)
77 b = np.zeros(M2)
78 self.W = tf.Variable(W.astype(np.float32))
79 self.b = tf.Variable(b.astype(np.float32))
80
81 def forward(self, X):
82 return self.f(tf.matmul(X, self.W) + self.b)
83
84
85class ANN(object):

Callers 1

fitMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected