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

Class Layer

unsupervised_class2/xwing.py:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22from sklearn.mixture import GaussianMixture
23
24class Layer(object):
25 def __init__(self, m1, m2):
26 W = init_weights((m1, m2))
27 bi = np.zeros(m2, dtype=np.float32)
28 bo = np.zeros(m1, dtype=np.float32)
29 self.W = theano.shared(W)
30 self.bi = theano.shared(bi)
31 self.bo = theano.shared(bo)
32 self.params = [self.W, self.bi, self.bo]
33
34 def forward(self, X):
35 return T.nnet.sigmoid(X.dot(self.W) + self.bi)
36
37 def forwardT(self, X):
38 return T.nnet.sigmoid(X.dot(self.W.T) + self.bo)
39
40
41class DeepAutoEncoder(object):

Callers 1

fitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected