#NEWLINE# def argmax( self , sol , idx , add_loss = False , opt_type = 'linear' ) : #NEWLINE# #INDENT# nd = self . dims #NEWLINE# d = 0 #NEWLINE# val = ( - ( 10 ** 10 ) ) #NEWLINE# cls = ( - 1 ) #NEWLINE# for c in range ( self . num_classes ) : #NEWLINE# #INDENT# foo = ( sol [ d : ( d + nd ) ] . trans ( ) * self . X [ : , idx ] ) #NEWLINE# d += nd #NEWLINE# if ( np . single ( foo ) > np . single ( val ) ) : #NEWLINE# #INDENT# val = foo #NEWLINE# cls = c #NEWLINE# #UNINDENT# #UNINDENT# if ( opt_type == 'quadratic' ) : #NEWLINE# #INDENT# normPsi = ( self . X [ : , idx ] . trans ( ) * self . X [ : , idx ] ) #NEWLINE# val = ( ( 2 * val ) - normPsi ) #NEWLINE# #UNINDENT# psi_idx = self . get_joint_feature_map ( idx , cls ) #NEWLINE# return ( val , cls , psi_idx )