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
6f0e3a0b
Commit
6f0e3a0b
authored
Feb 21, 2020
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Feb 21, 2020
Browse files
Internal change
PiperOrigin-RevId: 296561671
parent
e185b94c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
official/nlp/optimization.py
official/nlp/optimization.py
+2
-8
No files found.
official/nlp/optimization.py
View file @
6f0e3a0b
...
...
@@ -137,16 +137,10 @@ class AdamWeightDecay(tf.keras.optimizers.Adam):
use_locking
=
self
.
_use_locking
)
return
tf
.
no_op
()
def
apply_gradients
(
self
,
grads_and_vars
,
name
=
None
,
all_reduce_sum_gradients
=
True
):
def
apply_gradients
(
self
,
grads_and_vars
,
name
=
None
):
grads
,
tvars
=
list
(
zip
(
*
grads_and_vars
))
(
grads
,
_
)
=
tf
.
clip_by_global_norm
(
grads
,
clip_norm
=
1.0
)
return
super
(
AdamWeightDecay
,
self
).
apply_gradients
(
zip
(
grads
,
tvars
),
name
=
name
,
all_reduce_sum_gradients
=
all_reduce_sum_gradients
)
return
super
(
AdamWeightDecay
,
self
).
apply_gradients
(
zip
(
grads
,
tvars
))
def
_get_lr
(
self
,
var_device
,
var_dtype
,
apply_state
):
"""Retrieves the learning rate with the given state."""
...
...
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