Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. CNNx = tf.nn.embedding_lookup(emb_mat, cnnx) [N, M, L, W, dc]
  2.  
  3. filter_sizes = [100]
  4. heights = [5]
  5. outs = []
  6. for filter_size, height in zip(filter_sizes, heights):
  7. num_channels = 3
  8. filter_ = [1, height, num_channels, filter_size]
  9. strides = [1, 1, 1, 1]
  10.  
  11. xxc = tf.nn.conv2d(Acx, filter_, strides, "VALID") # [N*M, L, W/stride, d]
  12. out = tf.reduce_max(tf.nn.relu(xxc), 2) # [-1, L, d]
  13. outs.append(xxc)
  14.  
  15. concat_out = tf.concat(2, outs)
  16. xx = tf.reshape(concat_out, [-1, M, L, coz])
  17.  
  18. Ax = tf.nn.embedding_lookup(emb_mat, x)
  19. xx = tf.concat(3, [xx, Ax]) # [N, M, L, di]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement