Skip to content

Commit

Permalink
Updated the standard config file
Browse files Browse the repository at this point in the history
  • Loading branch information
neubig committed Jul 3, 2017
1 parent aa447b1 commit 2a67a55
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
44 changes: 27 additions & 17 deletions examples/standard.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# TODO: This config file is in the old format. We need to make it match debug.yaml

# Small config to help refactoring to make the model completely YAML based
defaults:
experiment:
model_file: examples/output/<EXP>.mod
Expand All @@ -10,24 +9,35 @@ defaults:
decode_every: 1
eval_metrics: bleu,wer
train:
train_src: examples/data/train.ja
train_trg: examples/data/train.en
dev_src: examples/data/dev.ja
dev_trg: examples/data/dev.en
train_filters:
- type: length
min: 1
max: 50
default_layer_dim: 512
dropout: 0.0
training_corpus: !BilingualTrainingCorpus
train_src: examples/data/train.ja
train_trg: examples/data/train.en
dev_src: examples/data/dev.ja
dev_trg: examples/data/dev.en
corpus_parser: !BilingualCorpusParser
src_reader: !PlainTextReader {}
trg_reader: !PlainTextReader {}
model: !DefaultTranslator
input_embedder: !SimpleWordEmbedder
emb_dim: 512
encoder: !BiLSTMEncoder
layers: 1
attender: !StandardAttender
hidden_dim: 512
state_dim: 512
input_dim: 512
output_embedder: !SimpleWordEmbedder
emb_dim: 512
decoder: !MlpSoftmaxDecoder
layers: 1
mlp_hidden_dim: 512
decode:
src_file: examples/data/test.ja
evaluate:
ref_file: examples/data/test.en

standard-1layer:
train:
encoder:
layers: 1

standard-2layer:
standard-dropout0.1:
train:
decoder_layers: 2
dropout: 0.1
1 change: 1 addition & 0 deletions xnmt/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def init_components_bottom_up(self, obj, post_init_shared_params):
if p.component_name == "." and p.param_name not in init_params:
init_params[p.param_name] = p.value_fct()
init_params = {key:val for key,val in init_params.items() if key in init_args}
print(type(obj))
initialized_obj = obj.__class__(**init_params)
if not hasattr(initialized_obj, "serialize_params"):
initialized_obj.serialize_params = serialize_params
Expand Down

0 comments on commit 2a67a55

Please sign in to comment.