cnn在自然语言处理上的应用

来源:8-1 课程总结_

追梦逐梦白日做梦

2017-10-29

import theano.tensor as T
x = T.imatrix('x')
shared_words = theano.shared(value=np.asarray(all_words, dtype=theano.config.floatX),
                             name='shared_words', borrow=True)
layer0_input = shared_words[x.flatten()].reshape((x.shape[0], 1, x.shape[1], shared_words.shape[1]))

all_words是词向量矩阵,这个layer0_input是将shared_words降为1维后进行reshape,可是x.shape[0],与x.shape[1]都是多少啊

写回答

1回答

卫峥

2017-10-29

你哪里找的代码??你自己的代码不知道输入是多少吗?一般0是行数,1是列数

0
0

深度学习之神经网络核心原理与算法

神经网络实现/Tensorflow框架/图片分类实现

474 学习 · 69 问题

查看课程