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
0015eedf
Commit
0015eedf
authored
Feb 05, 2020
by
Scott Zhu
Committed by
A. Unique TensorFlower
Feb 05, 2020
Browse files
Internal change
PiperOrigin-RevId: 293378746
parent
5d36f19b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/optimization.py
official/nlp/optimization.py
+2
-2
No files found.
official/nlp/optimization.py
View file @
0015eedf
...
@@ -125,7 +125,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
...
@@ -125,7 +125,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
def
_prepare_local
(
self
,
var_device
,
var_dtype
,
apply_state
):
def
_prepare_local
(
self
,
var_device
,
var_dtype
,
apply_state
):
super
(
AdamWeightDecay
,
self
).
_prepare_local
(
var_device
,
var_dtype
,
super
(
AdamWeightDecay
,
self
).
_prepare_local
(
var_device
,
var_dtype
,
apply_state
)
apply_state
)
apply_state
[
'weight_decay_rate'
]
=
tf
.
constant
(
apply_state
[
(
var_device
,
var_dtype
)][
'weight_decay_rate'
]
=
tf
.
constant
(
self
.
weight_decay_rate
,
name
=
'adam_weight_decay_rate'
)
self
.
weight_decay_rate
,
name
=
'adam_weight_decay_rate'
)
def
_decay_weights_op
(
self
,
var
,
learning_rate
,
apply_state
):
def
_decay_weights_op
(
self
,
var
,
learning_rate
,
apply_state
):
...
@@ -133,7 +133,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
...
@@ -133,7 +133,7 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
if
do_decay
:
if
do_decay
:
return
var
.
assign_sub
(
return
var
.
assign_sub
(
learning_rate
*
var
*
learning_rate
*
var
*
apply_state
[
'weight_decay_rate'
],
apply_state
[
(
var
.
device
,
var
.
dtype
.
base_dtype
)][
'weight_decay_rate'
],
use_locking
=
self
.
_use_locking
)
use_locking
=
self
.
_use_locking
)
return
tf
.
no_op
()
return
tf
.
no_op
()
...
...
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