MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / HiddenLayer

Class HiddenLayer

unsupervised_class2/vanishing.py:18–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17
18class HiddenLayer(object):
19 def __init__(self, D, M):
20 W = init_weights((D, M))
21 b = np.zeros(M, dtype=np.float32)
22 self.W = theano.shared(W)
23 self.b = theano.shared(b)
24 self.params = [self.W, self.b]
25
26 def forward(self, X):
27 # we want to use the sigmoid so we can observe
28 # the vanishing gradient!
29 return T.nnet.sigmoid(X.dot(self.W) + self.b)
30
31
32class ANN(object):

Callers 1

fitMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected