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

Class HiddenLayer

ann_class2/theano_ann.py:21–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class HiddenLayer(object):
22 def __init__(self, M1, M2, f):
23 self.M1 = M1
24 self.M2 = M2
25 self.f = f
26 W = init_weight(M1, M2)
27 b = np.zeros(M2)
28 self.W = theano.shared(W)
29 self.b = theano.shared(b)
30 self.params = [self.W, self.b]
31
32 def forward(self, X):
33 if self.f == T.nnet.relu:
34 return self.f(X.dot(self.W) + self.b, alpha=0.1)
35 return self.f(X.dot(self.W) + self.b)
36
37
38class ANN(object):

Callers 1

fitMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected