forked from google-research/t5x
-
Notifications
You must be signed in to change notification settings - Fork 8
/
t5_1_1_base_wmt_from_scratch.gin
64 lines (52 loc) · 1.64 KB
/
t5_1_1_base_wmt_from_scratch.gin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from __gin__ import dynamic_registration
import __main__ as train_script
import seqio
from t5.data import mixtures
from t5x import models
from t5x import partitioning
from t5x import utils
include "t5x/examples/t5/t5_1_1/base.gin"
include "t5x/configs/runs/pretrain.gin"
MIXTURE_OR_TASK_NAME = "wmt_t2t_ende_v003"
TASK_FEATURE_LENGTHS = {"inputs": 256, "targets": 256}
TRAIN_STEPS = 50000
DROPOUT_RATE = 0.0
train/utils.DatasetConfig:
batch_size = 128
use_cached = False
pack = True
seed = 0
train_eval/utils.DatasetConfig:
batch_size = 128
use_cached = False
pack = True
seed = 0
infer_eval/utils.DatasetConfig:
mixture_or_task_name = %MIXTURE_OR_TASK_NAME
task_feature_lengths = None # compute max
split = "validation"
seed = 0
batch_size = 128
shuffle = False
use_cached = False
train_script.train:
eval_period = 500
eval_steps = 20
random_seed = 0
use_hardware_rng = True
infer_eval_dataset_cfg = @infer_eval/utils.DatasetConfig()
inference_evaluator_cls = @seqio.Evaluator
partitioner = @partitioning.ModelBasedPjitPartitioner()
seqio.Evaluator:
logger_cls = [@seqio.PyLoggingLogger, @seqio.TensorBoardLogger, @seqio.JSONLogger]
num_examples = None # Use all examples in the infer_eval dataset.
use_memory_cache = True
utils.SaveCheckpointConfig:
period = 5000 # checkpoint frequency
# `num_decodes` is equivalent to a beam size in a beam search decoding.
models.EncoderDecoderModel.predict_batch_with_aux.num_decodes = 4
partitioning.ModelBasedPjitPartitioner.num_partitions = 2
utils.create_learning_rate_scheduler:
factors = 'constant * rsqrt_decay'
base_learning_rate = 1.0
warmup_steps = 10000