Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
2f9e2c0e
Commit
2f9e2c0e
authored
Apr 04, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert the local change to resnet_model
parent
5ef0578f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
examples/ResNet/resnet_model.py
examples/ResNet/resnet_model.py
+3
-11
No files found.
examples/ResNet/resnet_model.py
View file @
2f9e2c0e
...
@@ -81,12 +81,7 @@ def resnet_bottleneck(l, ch_out, stride, stride_first=False):
...
@@ -81,12 +81,7 @@ def resnet_bottleneck(l, ch_out, stride, stride_first=False):
"""
"""
shortcut
=
l
shortcut
=
l
l
=
Conv2D
(
'conv1'
,
l
,
ch_out
,
1
,
strides
=
stride
if
stride_first
else
1
,
activation
=
BNReLU
)
l
=
Conv2D
(
'conv1'
,
l
,
ch_out
,
1
,
strides
=
stride
if
stride_first
else
1
,
activation
=
BNReLU
)
if
stride
==
2
:
l
=
Conv2D
(
'conv2'
,
l
,
ch_out
,
3
,
strides
=
1
if
stride_first
else
stride
,
activation
=
BNReLU
)
l
=
tf
.
pad
(
l
,
[[
0
,
0
],[
0
,
0
],[
1
,
1
],[
1
,
1
]])
l
=
Conv2D
(
'conv2'
,
l
,
ch_out
,
3
,
strides
=
1
if
stride_first
else
stride
,
activation
=
BNReLU
,
padding
=
'VALID'
)
else
:
l
=
Conv2D
(
'conv2'
,
l
,
ch_out
,
3
,
strides
=
1
if
stride_first
else
stride
,
activation
=
BNReLU
)
l
=
Conv2D
(
'conv3'
,
l
,
ch_out
*
4
,
1
,
activation
=
get_bn
(
zero_init
=
True
))
l
=
Conv2D
(
'conv3'
,
l
,
ch_out
*
4
,
1
,
activation
=
get_bn
(
zero_init
=
True
))
return
l
+
resnet_shortcut
(
shortcut
,
ch_out
*
4
,
stride
,
activation
=
get_bn
(
zero_init
=
False
))
return
l
+
resnet_shortcut
(
shortcut
,
ch_out
*
4
,
stride
,
activation
=
get_bn
(
zero_init
=
False
))
...
@@ -122,11 +117,8 @@ def resnet_backbone(image, num_blocks, group_func, block_func):
...
@@ -122,11 +117,8 @@ def resnet_backbone(image, num_blocks, group_func, block_func):
with
argscope
(
Conv2D
,
use_bias
=
False
,
with
argscope
(
Conv2D
,
use_bias
=
False
,
kernel_initializer
=
tf
.
variance_scaling_initializer
(
scale
=
2.0
,
mode
=
'fan_out'
)):
kernel_initializer
=
tf
.
variance_scaling_initializer
(
scale
=
2.0
,
mode
=
'fan_out'
)):
logits
=
(
LinearWrap
(
image
)
logits
=
(
LinearWrap
(
image
)
.
tf
.
pad
([[
0
,
0
],[
0
,
0
],[
3
,
3
],[
3
,
3
]])
.
Conv2D
(
'conv0'
,
64
,
7
,
strides
=
2
,
activation
=
BNReLU
)
.
Conv2D
(
'conv0'
,
64
,
7
,
strides
=
2
,
activation
=
BNReLU
,
.
MaxPooling
(
'pool0'
,
shape
=
3
,
stride
=
2
,
padding
=
'SAME'
)
padding
=
'VALID'
)
.
tf
.
pad
([[
0
,
0
],[
0
,
0
],[
1
,
1
],[
1
,
1
]])
.
MaxPooling
(
'pool0'
,
shape
=
3
,
stride
=
2
,
padding
=
'VALID'
)
.
apply
(
group_func
,
'group0'
,
block_func
,
64
,
num_blocks
[
0
],
1
)
.
apply
(
group_func
,
'group0'
,
block_func
,
64
,
num_blocks
[
0
],
1
)
.
apply
(
group_func
,
'group1'
,
block_func
,
128
,
num_blocks
[
1
],
2
)
.
apply
(
group_func
,
'group1'
,
block_func
,
128
,
num_blocks
[
1
],
2
)
.
apply
(
group_func
,
'group2'
,
block_func
,
256
,
num_blocks
[
2
],
2
)
.
apply
(
group_func
,
'group2'
,
block_func
,
256
,
num_blocks
[
2
],
2
)
...
...
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