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
02c7112e
Commit
02c7112e
authored
May 19, 2020
by
Chen Chen
Committed by
A. Unique TensorFlower
May 19, 2020
Browse files
Internal Change
PiperOrigin-RevId: 312375806
parent
d9c4e454
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
official/benchmark/bert_pretrain_benchmark.py
official/benchmark/bert_pretrain_benchmark.py
+8
-8
No files found.
official/benchmark/bert_pretrain_benchmark.py
View file @
02c7112e
...
...
@@ -34,12 +34,12 @@ from official.utils.flags import core as flags_core
from
official.utils.misc
import
distribution_utils
# Pretrain masked lanauge modeling accuracy range:
MIN_MLM_ACCURACY
=
0.65
MAX_MLM_ACCURACY
=
0.6
6
MIN_MLM_ACCURACY
=
0.6
3
5
MAX_MLM_ACCURACY
=
0.6
45
# Pretrain next sentence prediction accuracy range:
MIN_NSP_ACCURACY
=
0.9
5
MAX_NSP_ACCURACY
=
0.9
8
MIN_NSP_ACCURACY
=
0.9
4
MAX_NSP_ACCURACY
=
0.9
6
BERT_PRETRAIN_FILES_SEQ128
=
'gs://mlcompass-data/bert/pretraining_data/seq_128/wikipedia.tfrecord*,gs://mlcompass-data/bert/pretraining_data/seq_128/books.tfrecord*'
BERT_BASE_CONFIG_FILE
=
'gs://cloud-tpu-checkpoints/bert/keras_bert/uncased_L-12_H-768_A-12/bert_config.json'
...
...
@@ -126,15 +126,15 @@ class BertPretrainAccuracyBenchmark(bert_benchmark_utils.BertBenchmarkBase):
FLAGS
.
dtype
=
'bf16'
@
owner_utils
.
Owner
(
'tf-model-garden'
)
def
benchmark_accuracy_8x8_tpu_bf16_seq128_
1m
_steps
(
self
):
"""Test bert pretraining with 8x8 TPU for
1 million
steps."""
def
benchmark_accuracy_8x8_tpu_bf16_seq128_
500k
_steps
(
self
):
"""Test bert pretraining with 8x8 TPU for
500k
steps."""
# This is used for accuracy test.
self
.
_setup
()
self
.
_specify_common_flags
()
FLAGS
.
num_steps_per_epoch
=
10
00000
FLAGS
.
num_steps_per_epoch
=
5
00000
FLAGS
.
num_train_epochs
=
1
FLAGS
.
model_dir
=
self
.
_get_model_dir
(
'benchmark_accuracy_8x8_tpu_bf16_seq128_
1m
_steps'
)
'benchmark_accuracy_8x8_tpu_bf16_seq128_
500k
_steps'
)
summary_path
=
os
.
path
.
join
(
FLAGS
.
model_dir
,
'summaries/training_summary.txt'
)
# Set train_summary_interval to -1 to disable training summary, because
...
...
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