Unverified Commit 11bf27e3 authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Adding some references on MobileNetV3 implementation. (#3850)

parent 5bb997c6
...@@ -19,7 +19,7 @@ model_urls = { ...@@ -19,7 +19,7 @@ model_urls = {
class SqueezeExcitation(nn.Module): class SqueezeExcitation(nn.Module):
# Implemented as described at Figure 4 of the MobileNetV3 paper
def __init__(self, input_channels: int, squeeze_factor: int = 4): def __init__(self, input_channels: int, squeeze_factor: int = 4):
super().__init__() super().__init__()
squeeze_channels = _make_divisible(input_channels // squeeze_factor, 8) squeeze_channels = _make_divisible(input_channels // squeeze_factor, 8)
...@@ -40,7 +40,7 @@ class SqueezeExcitation(nn.Module): ...@@ -40,7 +40,7 @@ class SqueezeExcitation(nn.Module):
class InvertedResidualConfig: class InvertedResidualConfig:
# Stores information listed at Tables 1 and 2 of the MobileNetV3 paper
def __init__(self, input_channels: int, kernel: int, expanded_channels: int, out_channels: int, use_se: bool, def __init__(self, input_channels: int, kernel: int, expanded_channels: int, out_channels: int, use_se: bool,
activation: str, stride: int, dilation: int, width_mult: float): activation: str, stride: int, dilation: int, width_mult: float):
self.input_channels = self.adjust_channels(input_channels, width_mult) self.input_channels = self.adjust_channels(input_channels, width_mult)
...@@ -58,7 +58,7 @@ class InvertedResidualConfig: ...@@ -58,7 +58,7 @@ class InvertedResidualConfig:
class InvertedResidual(nn.Module): class InvertedResidual(nn.Module):
# Implemented as described at section 5 of MobileNetV3 paper
def __init__(self, cnf: InvertedResidualConfig, norm_layer: Callable[..., nn.Module], def __init__(self, cnf: InvertedResidualConfig, norm_layer: Callable[..., nn.Module],
se_layer: Callable[..., nn.Module] = SqueezeExcitation): se_layer: Callable[..., nn.Module] = SqueezeExcitation):
super().__init__() super().__init__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment