diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-28 15:14:55 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-28 15:14:55 +0200 |
commit | c032ffb05a7ed86f8fe5d596f94e8997c558cae8 (patch) | |
tree | bf890ffd4c815db7d510cfb281d253b5728f70c6 /text_recognizer/networks/encoders/efficientnet/mbconv.py | |
parent | 524bf4351ac295bd4ff9914bb1f32eda7f7ff855 (diff) |
Reformatting with attrs, config for encoder and decoder
Diffstat (limited to 'text_recognizer/networks/encoders/efficientnet/mbconv.py')
-rw-r--r-- | text_recognizer/networks/encoders/efficientnet/mbconv.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/text_recognizer/networks/encoders/efficientnet/mbconv.py b/text_recognizer/networks/encoders/efficientnet/mbconv.py index e43771a..3aa63d0 100644 --- a/text_recognizer/networks/encoders/efficientnet/mbconv.py +++ b/text_recognizer/networks/encoders/efficientnet/mbconv.py @@ -26,7 +26,7 @@ class MBConvBlock(nn.Module): ) -> None: super().__init__() self.kernel_size = kernel_size - self.stride = (stride, ) * 2 if isinstance(stride, int) else stride + self.stride = (stride,) * 2 if isinstance(stride, int) else stride self.bn_momentum = bn_momentum self.bn_eps = bn_eps self.in_channels = in_channels @@ -68,8 +68,7 @@ class MBConvBlock(nn.Module): inner_channels = in_channels * expand_ratio self._inverted_bottleneck = ( self._configure_inverted_bottleneck( - in_channels=in_channels, - out_channels=inner_channels, + in_channels=in_channels, out_channels=inner_channels, ) if expand_ratio != 1 else None @@ -98,9 +97,7 @@ class MBConvBlock(nn.Module): ) def _configure_inverted_bottleneck( - self, - in_channels: int, - out_channels: int, + self, in_channels: int, out_channels: int, ) -> nn.Sequential: """Expansion phase.""" return nn.Sequential( |