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

Method forward_train

ann_class2/dropout_theano.py:124–132  ·  view source on GitHub ↗
(self, X)

Source from the content-addressed store, hash-verified

122 plt.show()
123
124 def forward_train(self, X):
125 Z = X
126 for h, p in zip(self.hidden_layers, self.dropout_rates[:-1]):
127 mask = self.rng.binomial(n=1, p=p, size=Z.shape)
128 Z = mask * Z
129 Z = h.forward(Z)
130 mask = self.rng.binomial(n=1, p=self.dropout_rates[-1], size=Z.shape)
131 Z = mask * Z
132 return T.nnet.softmax(Z.dot(self.W) + self.b)
133
134 def forward_predict(self, X):
135 Z = X

Callers 1

fitMethod · 0.95

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected