Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
91c2a429
Commit
91c2a429
authored
5 years ago
by
Tim Laibacher
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused parts of MobileNetV2
parent
49401e67
No related branches found
No related tags found
1 merge request
!1
Ssl
Pipeline
#30727
failed
5 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/ip/binseg/modeling/backbones/mobilenetv2.py
+8
-8
8 additions, 8 deletions
bob/ip/binseg/modeling/backbones/mobilenetv2.py
with
8 additions
and
8 deletions
bob/ip/binseg/modeling/backbones/mobilenetv2.py
+
8
−
8
View file @
91c2a429
...
@@ -80,14 +80,14 @@ class MobileNetV2(nn.Module):
...
@@ -80,14 +80,14 @@ class MobileNetV2(nn.Module):
[
6
,
32
,
3
,
2
],
[
6
,
32
,
3
,
2
],
[
6
,
64
,
4
,
2
],
[
6
,
64
,
4
,
2
],
[
6
,
96
,
3
,
1
],
[
6
,
96
,
3
,
1
],
[
6
,
160
,
3
,
2
],
#
[6, 160, 3, 2],
[
6
,
320
,
1
,
1
],
#
[6, 320, 1, 1],
]
]
# building first layer
# building first layer
assert
input_size
%
32
==
0
assert
input_size
%
32
==
0
input_channel
=
int
(
input_channel
*
width_mult
)
input_channel
=
int
(
input_channel
*
width_mult
)
self
.
last_channel
=
int
(
last_channel
*
width_mult
)
if
width_mult
>
1.0
else
last_channel
#
self.last_channel = int(last_channel * width_mult) if width_mult > 1.0 else last_channel
self
.
features
=
[
conv_bn
(
3
,
input_channel
,
2
)]
self
.
features
=
[
conv_bn
(
3
,
input_channel
,
2
)]
# building inverted residual blocks
# building inverted residual blocks
for
t
,
c
,
n
,
s
in
interverted_residual_setting
:
for
t
,
c
,
n
,
s
in
interverted_residual_setting
:
...
@@ -99,15 +99,15 @@ class MobileNetV2(nn.Module):
...
@@ -99,15 +99,15 @@ class MobileNetV2(nn.Module):
self
.
features
.
append
(
block
(
input_channel
,
output_channel
,
1
,
expand_ratio
=
t
))
self
.
features
.
append
(
block
(
input_channel
,
output_channel
,
1
,
expand_ratio
=
t
))
input_channel
=
output_channel
input_channel
=
output_channel
# building last several layers
# building last several layers
self
.
features
.
append
(
conv_1x1_bn
(
input_channel
,
self
.
last_channel
))
#
self.features.append(conv_1x1_bn(input_channel, self.last_channel))
# make it nn.Sequential
# make it nn.Sequential
self
.
features
=
nn
.
Sequential
(
*
self
.
features
)
self
.
features
=
nn
.
Sequential
(
*
self
.
features
)
# building classifier
# building classifier
self
.
classifier
=
nn
.
Sequential
(
#
self.classifier = nn.Sequential(
nn
.
Dropout
(
0.2
),
#
nn.Dropout(0.2),
nn
.
Linear
(
self
.
last_channel
,
n_class
),
#
nn.Linear(self.last_channel, n_class),
)
#
)
self
.
_initialize_weights
()
self
.
_initialize_weights
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment