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
ModelZoo
ResNet50_tensorflow
Commits
35f6f9c9
Commit
35f6f9c9
authored
Jun 15, 2017
by
Neal Wu
Committed by
GitHub
Jun 15, 2017
Browse files
Merge pull request #1536 from awilliamson/alexnet_lrn
Implemented LRN for AlexNet tutorial
parents
ea2f4704
11733fca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
tutorials/image/alexnet/alexnet_benchmark.py
tutorials/image/alexnet/alexnet_benchmark.py
+16
-3
No files found.
tutorials/image/alexnet/alexnet_benchmark.py
View file @
35f6f9c9
...
@@ -74,10 +74,15 @@ def inference(images):
...
@@ -74,10 +74,15 @@ def inference(images):
parameters
+=
[
kernel
,
biases
]
parameters
+=
[
kernel
,
biases
]
# lrn1
# lrn1
# TODO(shlens, jiayq): Add a GPU version of local response normalization.
with
tf
.
name_scope
(
'lrn1'
)
as
scope
:
lrn1
=
tf
.
nn
.
local_response_normalization
(
conv1
,
alpha
=
1e-4
,
beta
=
0.75
,
depth_radius
=
2
,
bias
=
2.0
)
# pool1
# pool1
pool1
=
tf
.
nn
.
max_pool
(
conv
1
,
pool1
=
tf
.
nn
.
max_pool
(
lrn
1
,
ksize
=
[
1
,
3
,
3
,
1
],
ksize
=
[
1
,
3
,
3
,
1
],
strides
=
[
1
,
2
,
2
,
1
],
strides
=
[
1
,
2
,
2
,
1
],
padding
=
'VALID'
,
padding
=
'VALID'
,
...
@@ -96,8 +101,16 @@ def inference(images):
...
@@ -96,8 +101,16 @@ def inference(images):
parameters
+=
[
kernel
,
biases
]
parameters
+=
[
kernel
,
biases
]
print_activations
(
conv2
)
print_activations
(
conv2
)
# lrn2
with
tf
.
name_scope
(
'lrn2'
)
as
scope
:
lrn2
=
tf
.
nn
.
local_response_normalization
(
conv2
,
alpha
=
1e-4
,
beta
=
0.75
,
depth_radius
=
2
,
bias
=
2.0
)
# pool2
# pool2
pool2
=
tf
.
nn
.
max_pool
(
conv
2
,
pool2
=
tf
.
nn
.
max_pool
(
lrn
2
,
ksize
=
[
1
,
3
,
3
,
1
],
ksize
=
[
1
,
3
,
3
,
1
],
strides
=
[
1
,
2
,
2
,
1
],
strides
=
[
1
,
2
,
2
,
1
],
padding
=
'VALID'
,
padding
=
'VALID'
,
...
...
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