#NEWLINE# def _compute( self , data_1 , data_2 ) : #NEWLINE# #INDENT# kernel = np . ones ( ( data_1 . shape [ 0 ] , data_2 . shape [ 0 ] ) ) #NEWLINE# for d in range ( data_1 . shape [ 1 ] ) : #NEWLINE# #INDENT# column_1 = data_1 [ : , d ] . reshape ( ( - 1 ) , 1 ) #NEWLINE# column_2 = data_2 [ : , d ] . reshape ( ( - 1 ) , 1 ) #NEWLINE# kernel *= ( ( 1 - ( self . _q ** 2 ) ) / ( 2.0 * ( ( 1.0 - ( ( 2.0 * self . _q ) * np . cos ( ( column_1 - column_2 . T ) ) ) ) + ( self . _q ** 2 ) ) ) ) #NEWLINE# #UNINDENT# return kernel