Tensorflow: What exactly does depthwise convolution do? -
i want use depthwise_conv2d tensorflow. fas understand now, performs regular 2d convolutions every single channel, each depth_multiplier
number of features.
then should expect, if depth_multiplier = 1
, have number of input channels same number of output channels. why can have 256 input channels , 512 output channels ? channels come from?
the filters of size[filter_height, filter_width, in_channels, channel_multiplier]
. if channel_multiplier = 1
, same number of input channels output. if n
, n*input_channels
output channels
, each input channe
l convolved n
filters.
for example,
inputs = tf.variable(tf.random_normal((20, 64,64,100))) filters = tf.variable(tf.random_normal((5,5,100,10))) out = tf.nn.depthwise_conv2d( inputs, filters, strides=[1,1,1,1], padding='same')
you out
of shape: shape=(20, 64, 64, 1000)
Comments
Post a Comment