cjiang2 / VDCNN

Implementation of Very Deep Convolutional Neural Network for Text Classification
171 stars 41 forks source link

There are a `for` loop in `Convolutional_Block` and only the last conv out is used,why? #8

Closed FrankWork closed 6 years ago

FrankWork commented 6 years ago

The code is:

for i in range(2):
  with tf.variable_scope("conv1d_%s" % str(i)):
      filter_shape = [3, inputs.get_shape()[2], num_filters]
      W = tf.get_variable(name='W', shape=filter_shape, 
          initializer=he_normal,
          regularizer=regularizer)
      out = tf.nn.conv1d(inputs, W, stride=1, padding="SAME")
      out = tf.layers.batch_normalization(inputs=out, momentum=0.997, epsilon=1e-5, 
                                      center=True, scale=True, training=is_training)
      out = tf.nn.relu(out)
      print("Conv1D:", out.get_shape())
cjiang2 commented 6 years ago

Damn I thought I fixed that, sorry for the confusion. :( Change all out to inputs should be fine.