<p dir="auto">As title</p>
<p dir="auto">As much as I have managed to follow the API section of tensorflow the depthwise_conv2d doesn't fulfill my thoughts on what I would like to do with the input/filters.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="shape = (2,5,5,48,128)
initializer = tf.truncated_normal_initializer(stddev=1e-2)
kernel = tf.get_variable(name='weights', shape=shape, initializer=initializer)"><pre class="notranslate"><code class="notranslate">shape = (2,5,5,48,128)
initializer = tf.truncated_normal_initializer(stddev=1e-2)
kernel = tf.get_variable(name='weights', shape=shape, initializer=initializer)
</code></pre></div>
<p dir="auto">Considering the input is of shape (batch_size, 55, 55, 96),<br>
the function definition would be:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def depthwise_group_conv2d(input, filter, groups, strides, padding, name)"><pre class="notranslate"><code class="notranslate">def depthwise_group_conv2d(input, filter, groups, strides, padding, name)
</code></pre></div>
<p dir="auto">which would be able to do</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="conv = tf.nn.depthwise_group_conv2d(input, kernel, [48,48], strides, padding, name)"><pre class="notranslate"><code class="notranslate">conv = tf.nn.depthwise_group_conv2d(input, kernel, [48,48], strides, padding, name)
</code></pre></div>
<p dir="auto">that would split the input depthwise into depths from given 'groups' parameter and perform the convolution with shared parameters (i.e. depths [:48] take weights[0] and depths[48:] take weights[1]) inside a group. Then the outputs of convolutions by groups would be concatenated depthwise.</p>
<p dir="auto">This would make it easier to define groups such as one used in AlexNet/CaffeNet architectures.</p>
<p dir="auto">Hopefully I have missed a certain feature already existing for making this easier.</p>
<p dir="auto">Best regards,<br>
Filip</p>