glove.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:gram 作者: mp2893 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号