#NEWLINE# def log_loss( y , t , eps = 1e-15 ) : #NEWLINE# #INDENT# '\n    cross entropy loss, summed over classes, mean over batches\n    ' #NEWLINE# y = T . clip ( y , eps , ( 1 - eps ) ) #NEWLINE# loss = ( ( - T . sum ( ( t * T . log ( y ) ) ) ) / y . shape [ 0 ] . astype ( theano . config . floatX ) ) #NEWLINE# return eps