Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
11bf27e3
Unverified
Commit
11bf27e3
authored
May 17, 2021
by
Vasilis Vryniotis
Committed by
GitHub
May 17, 2021
Browse files
Adding some references on MobileNetV3 implementation. (#3850)
parent
5bb997c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/models/mobilenetv3.py
torchvision/models/mobilenetv3.py
+3
-3
No files found.
torchvision/models/mobilenetv3.py
View file @
11bf27e3
...
@@ -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__
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment