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
6a2b8dd2
Commit
6a2b8dd2
authored
Aug 04, 2017
by
cclauss
Committed by
GitHub
Aug 04, 2017
Browse files
center() is defined in utils
Also define xrange() for Python 3. See #2105
parent
424f8da6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
rebar/rebar.py
rebar/rebar.py
+6
-1
No files found.
rebar/rebar.py
View file @
6a2b8dd2
...
@@ -26,6 +26,11 @@ import tensorflow.contrib.slim as slim
...
@@ -26,6 +26,11 @@ import tensorflow.contrib.slim as slim
from
tensorflow.python.ops
import
init_ops
from
tensorflow.python.ops
import
init_ops
import
utils
as
U
import
utils
as
U
try
:
xrange
# Python 2
except
NameError
:
xrange
=
range
# Python 3
FLAGS
=
tf
.
flags
.
FLAGS
FLAGS
=
tf
.
flags
.
FLAGS
Q_COLLECTION
=
"q_collection"
Q_COLLECTION
=
"q_collection"
...
@@ -293,7 +298,7 @@ class SBN(object): # REINFORCE
...
@@ -293,7 +298,7 @@ class SBN(object): # REINFORCE
logQHard
=
tf
.
add_n
(
logQHard
)
logQHard
=
tf
.
add_n
(
logQHard
)
# REINFORCE
# REINFORCE
learning_signal
=
tf
.
stop_gradient
(
center
(
reinforce_learning_signal
))
learning_signal
=
tf
.
stop_gradient
(
U
.
center
(
reinforce_learning_signal
))
self
.
optimizerLoss
=
-
(
learning_signal
*
logQHard
+
self
.
optimizerLoss
=
-
(
learning_signal
*
logQHard
+
reinforce_model_grad
)
reinforce_model_grad
)
self
.
lHat
=
map
(
tf
.
reduce_mean
,
[
self
.
lHat
=
map
(
tf
.
reduce_mean
,
[
...
...
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