-
Notifications
You must be signed in to change notification settings - Fork 75.2k
Description
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.
shape = (2,5,5,48,128)
initializer = tf.truncated_normal_initializer(stddev=1e-2)
kernel = tf.get_variable(name='weights', shape=shape, initializer=initializer)
Considering the input is of shape (batch_size, 55, 55, 96),
the function definition would be:
def depthwise_group_conv2d(input, filter, groups, strides, padding, name)
which would be able to do
conv = tf.nn.depthwise_group_conv2d(input, kernel, [48,48], strides, padding, name)
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.
This would make it easier to define groups such as one used in AlexNet/CaffeNet architectures.
Hopefully I have missed a certain feature already existing for making this easier.
Best regards,
Filip