save_model: inchi2iupac
save_data: inchi2iupac/objects

# Specific arguments for pyonmttok
# Char level, space is separate token
src_onmttok_kwargs: "{'mode': 'char', 'spacer_annotate': True, 'spacer_new': True}"
tgt_onmttok_kwargs: "{'mode': 'char', 'spacer_annotate': True, 'spacer_new': True}"
src_vocab: inchi_vocab
tgt_vocab: iupac_vocab

# Corpus opts:
data:
    train:
        path_src: path/to/trainset_source
        path_tgt: path/to/trainset_target
        transforms: [onmt_tokenize]
    valid:
        path_src: path/to/valset_source
        path_tgt: path/to/valset_target
        transforms: [onmt_tokenize]

# silently ignore empty lines in the data
skip_empty_level: silent

# General options
keep_checkpoint: 5
save_checkpoint_steps: 3200
seed: 1234
report_every: 320
train_steps: 10000000
valid_steps: 3200 #validate every X steps

# Batching
queue_size: 40 #10000 
bucket_size: 32768 #examples per dynamically generated dataset
pool_factor: 8192 #shuffle buffer for bucket by length (batches)
world_size: 1 #number of GPUs
gpu_ranks: [0] #gpu(s) to use
batch_type: "tokens" #dynamic batching
batch_size: 4096
valid_batch_size: 128 #validation does not use dynamic batching
max_generator_batches: 0 #0 #batches to sequence in parallel - uses up mem.
batch_size_multiple: 1 #for "token" batching
accum_count: [4] #accumulate grads after 4 batches
accum_steps: [0] #accumulate on step 0

# Optimization
model_dtype: "fp32"
optim: "adam"
learning_rate: 1
warmup_steps: 8000 #Need a lot more if training on 4x nodes
decay_method: "noam"
adam_beta2: 0.998
max_grad_norm: 0
label_smoothing: 0.1
param_init: 0
param_init_glorot: true
normalization: "tokens"
early_stopping: 3 #after X times of non-improved val accuracy/perplexity

# Model
encoder_type: transformer
decoder_type: transformer
position_encoding: true
enc_layers: 6
dec_layers: 6
heads: 8
rnn_size: 512
word_vec_size: 512
transformer_ff: 2048 #size of feedforward hidden layer
dropout_steps: [0]
dropout: [0.1]
attention_dropout: [0.1]
