def load_data(infile):
cooccurMap = pickle.load(open(infile, 'rb'))
I = []
J = []
Weight = []
for key, value in cooccurMap.iteritems():
I.append(key[0])
J.append(key[1])
Weight.append(weightFunction(value))
shared_I = theano.shared(np.asarray(I, dtype='int32'), borrow=True)
shared_J = theano.shared(np.asarray(J, dtype='int32'), borrow=True)
shared_Weight = theano.shared(np.asarray(Weight, dtype=theano.config.floatX), borrow=True)
return shared_I, shared_J, shared_Weight
评论列表
文章目录