예제 #1
0
파일: mlnn.py 프로젝트: sydney0zq/nn-c
    def predict(self, X):
        mulGate = MultiplyGate()
        addGate = AddGate()
        layer = Tanh()
        softmaxOutput = Softmax()

        input = X
        for i in range(len(self.W)):
            mul = mulGate.forward(self.W[i], input)
            add = addGate.forward(mul, self.b[i])
            input = layer.forward(add)

        probs = softmaxOutput.predict(input)
        return np.argmax(probs, axis=1)
예제 #2
0
 def predict(self, x):
     output = Softmax()
     layers = self.forward_propagation(x)
     return [np.argmax(output.predict(layer.mulv)) for layer in layers]
예제 #3
0
파일: rnn.py 프로젝트: pieterwolfert/ccn
 def predict(self, x):
     """Calculate the predictions given data x."""
     output = Softmax()
     layers = self.forward_propagation(x)
     return [np.argmax(output.predict(layer.mulv)) for layer in layers]