#NEWLINE# def cosine( x , y ) : #NEWLINE# #INDENT# d = T . dot ( x , y . T ) #NEWLINE# d /= l2norm ( x ) . dimshuffle ( 0 , 'x' ) #NEWLINE# d /= l2norm ( y ) . dimshuffle ( 'x' , 0 ) #NEWLINE# return x