Skip to content

Conversation

@bedapisl
Copy link
Contributor

No description provided.

@bedapisl bedapisl requested a review from blazekadam November 20, 2018 15:25
Copy link
Contributor

@FloopCZ FloopCZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @bedapisl for adding this directly to blocks, I sincerely hope this will help us with the network speed on ARM.

raise ValueError('SeparableConvBlock only supports inputs with rank 4 \
(i.e. batch_size, height, width, channels)')

x = slim.separable_conv2d(x, num_outputs=self._channels, kernel_size=(self._kernel, self._kernel),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I have to admit that I would prefer tf.layers in new code, but the variable scopes would not work. :-/)
https://www.tensorflow.org/api_docs/python/tf/layers/separable_conv2d

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue for it... (#9)

**kwargs)

def _handle_parsed_args(self, channels: str, kernel: str,
__, stride: Union[str, int]) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double underscore.

**code**: ``(num_filters)sep(kernel_size)[s(stride)]``
**examples**: ``64sep3``, ``64sep3s2``, ``64sep3-5s2``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does 64sep3-5s2 actually work? 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, my fault.

self._channels, self._kernel, self._stride = int(channels), int(kernel), int(stride)

def apply(self, x: tf.Tensor) -> tf.Tensor:
if len(self._extra_dim) >= 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not check the length of the shape of x directly?


def inverse_code(self) -> str:
if self._stride > 1:
raise ValueError('Inverse code for conv block is not defined for stride `{}`'.format(self._stride))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separable conv block

raise ValueError('SeparableConvBlock only supports inputs with rank 4 \
(i.e. batch_size, height, width, channels)')

x = slim.separable_conv2d(x, num_outputs=self._channels, kernel_size=(self._kernel, self._kernel),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue for it... (#9)

@bedapisl bedapisl merged commit e1058fc into dev Nov 21, 2018
@FloopCZ FloopCZ deleted the separable_convolution branch November 21, 2018 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants