Skip to content

Commit

Permalink
Add OpenNMT configs for training and for sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
leod committed Feb 16, 2019
1 parent ffb0a43 commit 63b659b
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 1 deletion.
34 changes: 34 additions & 0 deletions train/opennmt_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
data:
train_features_file: ../../data/data.train.bpe.shuf.titles
train_labels_file: ../../data/data.train.bpe.shuf.comments
eval_features_file: ../../data/data.dev.bpe.titles
eval_labels_file: ../../data/data.dev.bpe.comments

source_words_vocabulary: ../../data/vocab.titles
target_words_vocabulary: ../../data/vocab.comments

params:
average_loss_in_time: true
label_smoothing: 0.1
optimizer: LazyAdamOptimizer
optimizer_params:
beta1: 0.9
beta2: 0.998
learning_rate: 2
decay_type: noam_decay_v2
decay_params:
model_dim: 512
warmup_steps: 8000

train:
effective_batch_size: 8192
batch_size: 4096
batch_type: tokens
maximum_features_length: 300
maximum_labels_length: 300
keep_checkpoint_max: 2
average_last_checkpoints: 8
train_steps: 300000

eval:
eval_delay: 7200
34 changes: 34 additions & 0 deletions train/opennmt_config_larger_batch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
data:
train_features_file: ../../data/data.train.bpe.shuf.titles
train_labels_file: ../../data/data.train.bpe.shuf.comments
eval_features_file: ../../data/data.dev.bpe.titles
eval_labels_file: ../../data/data.dev.bpe.comments

source_words_vocabulary: ../../data/vocab.titles
target_words_vocabulary: ../../data/vocab.comments

params:
average_loss_in_time: true
label_smoothing: 0.1
optimizer: LazyAdamOptimizer
optimizer_params:
beta1: 0.9
beta2: 0.998
learning_rate: 2
decay_type: noam_decay_v2
decay_params:
model_dim: 512
warmup_steps: 8000

train:
effective_batch_size: 32384
batch_size: 4096
batch_type: tokens
maximum_features_length: 300
maximum_labels_length: 300
keep_checkpoint_max: 2
average_last_checkpoints: 8
train_steps: 300000

eval:
eval_delay: 7200
2 changes: 1 addition & 1 deletion train/sample.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
params:
sampling_topk: 0
sampling_topk: 10
beam_width: 1
3 changes: 3 additions & 0 deletions train/sample100.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
params:
sampling_topk: 100
beam_width: 1
3 changes: 3 additions & 0 deletions train/sample2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
params:
sampling_topk: 2
beam_width: 1
3 changes: 3 additions & 0 deletions train/sample30.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
params:
sampling_topk: 30
beam_width: 1
3 changes: 3 additions & 0 deletions train/sample_full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
params:
sampling_topk: 0
beam_width: 1

0 comments on commit 63b659b

Please sign in to comment.