Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CNNx = tf.nn.embedding_lookup(emb_mat, cnnx) [N, M, L, W, dc]
- filter_sizes = [100]
- heights = [5]
- outs = []
- for filter_size, height in zip(filter_sizes, heights):
- num_channels = 3
- filter_ = [1, height, num_channels, filter_size]
- strides = [1, 1, 1, 1]
- xxc = tf.nn.conv2d(Acx, filter_, strides, "VALID") # [N*M, L, W/stride, d]
- out = tf.reduce_max(tf.nn.relu(xxc), 2) # [-1, L, d]
- outs.append(xxc)
- concat_out = tf.concat(2, outs)
- xx = tf.reshape(concat_out, [-1, M, L, coz])
- Ax = tf.nn.embedding_lookup(emb_mat, x)
- xx = tf.concat(3, [xx, Ax]) # [N, M, L, di]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement