#NEWLINE# def __incremental_embedding_update( self , resource , args ) : #NEWLINE# #INDENT# verbose = False #NEWLINE# n = resource . get ( 'n' ) #NEWLINE# d = resource . get ( 'd' ) #NEWLINE# S = resource . get_list ( 'S' ) #NEWLINE# X = numpy . array ( resource . get ( 'X' ) ) #NEWLINE# t_max = 1.0 #NEWLINE# epsilon = 0.01 #NEWLINE# t_start = time . time ( ) #NEWLINE# ( X , emp_loss_new , hinge_loss_new , acc ) = utilsMDS . computeEmbeddingWithGD ( X , S , max_iters = 1 , verbose = verbose ) #NEWLINE# k = 1 #NEWLINE# while ( ( ( time . time ( ) - t_start ) < ( 0.5 * t_max ) ) and ( acc > epsilon ) ) : #NEWLINE# #INDENT# ( X , emp_loss_new , hinge_loss_new , acc ) = utilsMDS . computeEmbeddingWithGD ( X , S , max_iters = ( 2 ** k ) , verbose = verbose ) #NEWLINE# k += 1 #NEWLINE# #UNINDENT# resource . set ( 'X' , X . tolist ( ) )