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
e97ce38d
Commit
e97ce38d
authored
May 21, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo in last commit (fix #1202)
parent
b1c82a9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
examples/keras/mnist-keras.py
examples/keras/mnist-keras.py
+2
-1
No files found.
examples/keras/mnist-keras.py
View file @
e97ce38d
...
@@ -43,6 +43,7 @@ def get_keras_model():
...
@@ -43,6 +43,7 @@ def get_keras_model():
with
clear_tower0_name_scope
():
with
clear_tower0_name_scope
():
M
=
keras
.
models
.
Sequential
()
M
=
keras
.
models
.
Sequential
()
M
.
add
(
KL
.
Conv2D
(
32
,
3
,
activation
=
'relu'
,
input_shape
=
[
IMAGE_SIZE
,
IMAGE_SIZE
,
1
],
padding
=
'same'
))
M
.
add
(
KL
.
Conv2D
(
32
,
3
,
activation
=
'relu'
,
input_shape
=
[
IMAGE_SIZE
,
IMAGE_SIZE
,
1
],
padding
=
'same'
))
M
.
add
(
KL
.
BatchNormalization
())
M
.
add
(
KL
.
MaxPooling2D
())
M
.
add
(
KL
.
MaxPooling2D
())
M
.
add
(
KL
.
Conv2D
(
32
,
3
,
activation
=
'relu'
,
padding
=
'same'
))
M
.
add
(
KL
.
Conv2D
(
32
,
3
,
activation
=
'relu'
,
padding
=
'same'
))
M
.
add
(
KL
.
Conv2D
(
32
,
3
,
activation
=
'relu'
,
padding
=
'same'
))
M
.
add
(
KL
.
Conv2D
(
32
,
3
,
activation
=
'relu'
,
padding
=
'same'
))
...
@@ -68,7 +69,7 @@ class Model(ModelDesc):
...
@@ -68,7 +69,7 @@ class Model(ModelDesc):
logits
=
M
(
image
)
logits
=
M
(
image
)
if
ctx
.
is_main_training_tower
:
if
ctx
.
is_main_training_tower
:
for
op
in
M
.
updates
:
for
op
in
M
.
updates
:
tf
.
add_to_collection
(
tf
.
GraphKeys
.
UPDATE_OPS
)
tf
.
add_to_collection
(
tf
.
GraphKeys
.
UPDATE_OPS
,
op
)
# build cost function by tensorflow
# build cost function by tensorflow
cost
=
tf
.
nn
.
sparse_softmax_cross_entropy_with_logits
(
logits
=
logits
,
labels
=
label
)
cost
=
tf
.
nn
.
sparse_softmax_cross_entropy_with_logits
(
logits
=
logits
,
labels
=
label
)
...
...
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