Demo entry 6716210



Submitted by anonymous on Feb 17, 2018 at 13:51
Language: Python. Code size: 720 Bytes.

  def _conv(self, name, l, out_channel, kernel_size=3, stride=1, padding='SAME'):
      in_channel = l.get_shape().as_list()[3]
      with tf.variable_scope(name):
          n = kernel_size * kernel_size * out_channel
          weights = tf.get_variable('weights',
                                    shape=[kernel_size, kernel_size, in_channel, out_channel],
                                    initializer=tf.random_normal_initializer(stddev=np.sqrt(2.0 / n)),
          return tf.nn.conv2d(l, weights, [1, stride, stride, 1], padding=padding)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).