InvertedResidual

pull/58/head
johnzja 2020-08-11 16:11:29 +08:00
parent 8baea984ca
commit 9c6b0b1dec
3 changed files with 16 additions and 3 deletions

View File

@ -3,9 +3,8 @@ import torch.nn as nn
from mmcv.cnn import ConvModule, constant_init, kaiming_init
from torch.nn.modules.batchnorm import _BatchNorm
from mmseg.models.backbones.mobile_net_v2 import InvertedResidual
from mmseg.models.decode_heads.psp_head import PPM
from mmseg.ops import DepthwiseSeparableConvModule, resize
from mmseg.ops import DepthwiseSeparableConvModule, InvertedResidual, resize
from ..builder import BACKBONES

View File

@ -1,5 +1,8 @@
from .encoding import Encoding
from .inverted_residual_module import InvertedResidual
from .separable_conv_module import DepthwiseSeparableConvModule
from .wrappers import resize
__all__ = ['resize', 'DepthwiseSeparableConvModule', 'Encoding']
__all__ = [
'resize', 'DepthwiseSeparableConvModule', 'InvertedResidual', 'Encoding'
]

View File

@ -3,6 +3,17 @@ from torch import nn
class InvertedResidual(nn.Module):
"""Inverted Residual Module
Args:
inp (int): input channels.
oup (int): output channels.
stride (int): downsampling factor.
expand_ratio (int): 1 or 2.
dilation (int): Dilated conv. Default: 1
conv_cfg (dict|None): Config of conv layers.
norm_cfg (dict|None): Config of norm layers.
act_cfg (dict): Config of activation layers.
"""
def __init__(self,
inp,