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
da2465fd
Commit
da2465fd
authored
Dec 13, 2021
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Dec 13, 2021
Browse files
Internal change
PiperOrigin-RevId: 416070060
parent
30b6976e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
official/nlp/configs/experiments/glue_mnli_text.yaml
official/nlp/configs/experiments/glue_mnli_text.yaml
+50
-0
official/nlp/configs/finetuning_experiments.py
official/nlp/configs/finetuning_experiments.py
+42
-0
No files found.
official/nlp/configs/experiments/glue_mnli_text.yaml
0 → 100644
View file @
da2465fd
task
:
hub_module_url
:
'
'
model
:
num_classes
:
3
init_checkpoint
:
'
'
train_data
:
drop_remainder
:
true
global_batch_size
:
32
is_training
:
true
seq_length
:
128
shuffle_buffer_size
:
100
tfds_name
:
'
glue/mnli'
tfds_split
:
'
train'
text_fields
:
[
'
premise'
,
'
hypothesis'
]
vocab_file
:
'
'
lower_case
:
true
validation_data
:
drop_remainder
:
false
global_batch_size
:
32
is_training
:
false
seq_length
:
128
tfds_name
:
'
glue/mnli'
tfds_split
:
'
validation_matched'
text_fields
:
[
'
premise'
,
'
hypothesis'
]
vocab_file
:
'
'
lower_case
:
true
trainer
:
checkpoint_interval
:
3000
max_to_keep
:
5
optimizer_config
:
learning_rate
:
polynomial
:
cycle
:
false
decay_steps
:
36813
end_learning_rate
:
0.0
initial_learning_rate
:
3.0e-05
power
:
1.0
type
:
polynomial
optimizer
:
type
:
adamw
warmup
:
polynomial
:
power
:
1
warmup_steps
:
3681
type
:
polynomial
steps_per_loop
:
1000
summary_interval
:
1000
train_steps
:
36813
validation_interval
:
6135
validation_steps
:
307
official/nlp/configs/finetuning_experiments.py
View file @
da2465fd
...
@@ -64,6 +64,48 @@ def bert_sentence_prediction() -> cfg.ExperimentConfig:
...
@@ -64,6 +64,48 @@ def bert_sentence_prediction() -> cfg.ExperimentConfig:
return
config
return
config
@
exp_factory
.
register_config_factory
(
'bert/sentence_prediction_text'
)
def
bert_sentence_prediction_text
()
->
cfg
.
ExperimentConfig
:
r
"""BERT sentence prediction with raw text data.
Example: use tf.text and tfds as input with glue_mnli_text.yaml
"""
config
=
cfg
.
ExperimentConfig
(
task
=
sentence_prediction
.
SentencePredictionConfig
(
train_data
=
sentence_prediction_dataloader
.
SentencePredictionTextDataConfig
(),
validation_data
=
sentence_prediction_dataloader
.
SentencePredictionTextDataConfig
(
is_training
=
False
,
drop_remainder
=
False
)),
trainer
=
cfg
.
TrainerConfig
(
optimizer_config
=
optimization
.
OptimizationConfig
({
'optimizer'
:
{
'type'
:
'adamw'
,
'adamw'
:
{
'weight_decay_rate'
:
0.01
,
'exclude_from_weight_decay'
:
[
'LayerNorm'
,
'layer_norm'
,
'bias'
],
}
},
'learning_rate'
:
{
'type'
:
'polynomial'
,
'polynomial'
:
{
'initial_learning_rate'
:
3e-5
,
'end_learning_rate'
:
0.0
,
}
},
'warmup'
:
{
'type'
:
'polynomial'
}
})),
restrictions
=
[
'task.train_data.is_training != None'
,
'task.validation_data.is_training != None'
])
return
config
@
exp_factory
.
register_config_factory
(
'bert/squad'
)
@
exp_factory
.
register_config_factory
(
'bert/squad'
)
def
bert_squad
()
->
cfg
.
ExperimentConfig
:
def
bert_squad
()
->
cfg
.
ExperimentConfig
:
"""BERT Squad V1/V2."""
"""BERT Squad V1/V2."""
...
...
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