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
a470b1c1
Commit
a470b1c1
authored
Feb 18, 2021
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Feb 18, 2021
Browse files
Internal change
PiperOrigin-RevId: 358201408
parent
12acb414
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
official/nlp/configs/experiment_configs.py
official/nlp/configs/experiment_configs.py
+1
-0
official/nlp/configs/pretraining_experiments.py
official/nlp/configs/pretraining_experiments.py
+60
-0
No files found.
official/nlp/configs/experiment_configs.py
View file @
a470b1c1
...
...
@@ -16,3 +16,4 @@
"""Experiments definition."""
# pylint: disable=unused-import
from
official.nlp.configs
import
finetuning_experiments
from
official.nlp.configs
import
pretraining_experiments
official/nlp/configs/pretraining_experiments.py
0 → 100644
View file @
a470b1c1
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Pretraining experiment configurations."""
# pylint: disable=g-doc-return-or-yield,line-too-long
from
official.core
import
config_definitions
as
cfg
from
official.core
import
exp_factory
from
official.modeling
import
optimization
from
official.nlp.data
import
pretrain_dataloader
from
official.nlp.tasks
import
masked_lm
@
exp_factory
.
register_config_factory
(
'bert/pretraining'
)
def
bert_pretraining
()
->
cfg
.
ExperimentConfig
:
"""BERT pretraining experiment."""
config
=
cfg
.
ExperimentConfig
(
task
=
masked_lm
.
MaskedLMConfig
(
train_data
=
pretrain_dataloader
.
BertPretrainDataConfig
(),
validation_data
=
pretrain_dataloader
.
BertPretrainDataConfig
(
is_training
=
False
)),
trainer
=
cfg
.
TrainerConfig
(
train_steps
=
1000000
,
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'
:
1e-4
,
'end_learning_rate'
:
0.0
,
}
},
'warmup'
:
{
'type'
:
'polynomial'
}
})),
restrictions
=
[
'task.train_data.is_training != None'
,
'task.validation_data.is_training != None'
])
return
config
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