DEEP-PolyU / AANE_Python

Accelerated Attributed Network Embedding, SDM 2017
50 stars 17 forks source link

AANE_fun: ValueError: matrix type must be 'f', 'd', 'F', or 'D' #1

Closed calliwen closed 6 years ago

calliwen commented 6 years ago

emb_matrix = AANE_fun(data_net_matrix, data_attr_matrix, d = 128 )

when I use AANE to get the data_attr_net_matrix embedding matrix, is wrong.

calliwen commented 6 years ago

I solved this problem by mapping elem.type from long to float for the net_matrix and attr_matrix.

def change_elemType(net_matrix): net_matrix_list = net_matrix.tolist() node_num = len( net_matrix_list ) for index in range( node_num ): net_matrix_list[index] = list(map(float, net_matrix_list[index])) return np.matrix( net_matrix_list )

xhuang31 commented 6 years ago

Thanks @calliwen. I didn't pay attention to this. All my data is loaded from .mat files, with the default format as float.