Last active
August 29, 2015 14:28
-
-
Save dean-shaff/7f9da09965628d95c2c3 to your computer and use it in GitHub Desktop.
feedforward step for neural net
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def feed_forward(self,x): | |
""" | |
Calculate the value(s) of the neural net at the output level. | |
""" | |
y_guess = self.act(T.dot(x,self.W[0])+ self.b[0]) | |
for i in xrange(1,len(self.W)): | |
W = self.W[i] | |
b = self.b[i] | |
if i == len(self.W)-1: | |
y_guess = T.nnet.softmax(T.dot(y_guess,W)+b) | |
else: | |
y_guess = self.act(T.dot(y_guess,W)+b) | |
return y_guess |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment