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
396fd9de
Commit
396fd9de
authored
Sep 16, 2020
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 332061237
parent
543755a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
official/nlp/bert/model_training_utils.py
official/nlp/bert/model_training_utils.py
+6
-4
No files found.
official/nlp/bert/model_training_utils.py
View file @
396fd9de
...
...
@@ -164,9 +164,9 @@ def run_customized_training_loop(
evaluation is skipped.
eval_steps: Number of steps to run evaluation. Required if `eval_input_fn`
is not none.
metric_fn: A metrics function that returns a Keras Metric object
to rec
or
d
evaluation result using evaluation dataset or with training dataset
after every epoch.
metric_fn: A metrics function that returns
either
a Keras Metric object or
a list of Keras Metric objects to record evaluation result using
evaluation dataset or with training dataset
after every epoch.
init_checkpoint: Optional checkpoint to load to `sub_model` returned by
`model_fn`.
custom_callbacks: A list of Keras Callbacks objects to run during
...
...
@@ -291,7 +291,9 @@ def run_customized_training_loop(
logging
.
info
(
'Loading from checkpoint file completed'
)
train_loss_metric
=
tf
.
keras
.
metrics
.
Mean
(
'training_loss'
,
dtype
=
tf
.
float32
)
eval_metrics
=
[
metric_fn
()]
if
metric_fn
else
[]
eval_metrics
=
metric_fn
()
if
metric_fn
else
[]
if
not
isinstance
(
eval_metrics
,
list
):
eval_metrics
=
[
eval_metrics
]
# If evaluation is required, make a copy of metric as it will be used by
# both train and evaluation.
train_metrics
=
[
...
...
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