def separable_conv(self, bottom, in_channels, out_channels, name):
with tf.variable_scope(name):
filter_size_h = 1
filter_size_w = 1
filt = tf.get_variable(name=name + "_filters",
shape=[filter_size_h, filter_size_w, in_channels, out_channels],
initializer=init_ops.random_normal_initializer(stddev=0.01))
conv_biases = tf.get_variable(name=name + "_biases", shape=[out_channels], initializer=init_ops.random_normal_initializer(stddev=0.01))
conv = tf.nn.conv2d(bottom, filt, [1, 1, 1, 1], padding='SAME')
bias = tf.nn.bias_add(conv, conv_biases)
relu = tf.nn.relu(bias)
return relu
评论列表
文章目录