#NEWLINE# def predict_p( self , new_data ) : #NEWLINE# #INDENT# next_layer_input = new_data #NEWLINE# for ( i , layer ) in enumerate ( self . layers ) : #NEWLINE# #INDENT# if ( next_layer_input < ( len ( self . layers ) - 1 ) ) : #NEWLINE# #INDENT# next_layer_input = self . activations [ i ] ( ( T . dot ( next_layer_input , layer . W ) + layer . b ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# p_y_given_x = T . nnet . softmax ( ( T . dot ( next_layer_input , layer . W ) + layer . b ) ) #NEWLINE# #UNINDENT# #UNINDENT# return p_y_given_x