-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial report refactoring * reporting working * clean up * re-add max_num_sents feature to inference * fix unit tests * fix report unit test and give error message if compute_report was not enabled * create parent dir for reports and set default locations * draft for segmenting reporter * attention reports with speech on source side * add doc; share some code via HTML reporter base class
- Loading branch information
Showing
12 changed files
with
394 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,32 @@ | ||
# This example demonstrates reporting of attention matrices. | ||
# XNMT supports writing out reports, such as attention matrices generated during inference. | ||
# These are generally created by setting exp_global.compute_report to True, and adding one or several reporters | ||
# to the inference class. | ||
report: !Experiment | ||
exp_global: !ExpGlobal | ||
default_layer_dim: 256 | ||
dropout: 0.0 | ||
compute_report: True | ||
model: !DefaultTranslator | ||
src_reader: !PlainTextReader | ||
vocab: !Vocab {vocab_file: examples/data/head.ja.vocab} | ||
trg_reader: !PlainTextReader | ||
vocab: !Vocab {vocab_file: examples/data/head.en.vocab} | ||
src_embedder: !SimpleWordEmbedder | ||
emb_dim: 256 | ||
encoder: !BiLSTMSeqTransducer | ||
layers: 1 | ||
input_dim: 256 | ||
attender: !MlpAttender | ||
state_dim: 256 | ||
hidden_dim: 256 | ||
input_dim: 256 | ||
trg_embedder: !SimpleWordEmbedder | ||
emb_dim: 256 | ||
decoder: !AutoRegressiveDecoder | ||
rnn: !UniLSTMSeqTransducer | ||
layers: 1 | ||
transform: !AuxNonLinear | ||
output_dim: 256 | ||
bridge: !NoBridge {} | ||
inference: !AutoRegressiveInference {} | ||
train: !SimpleTrainingRegimen | ||
run_for_epochs: 1 | ||
trainer: !AdamTrainer | ||
alpha: 0.01 | ||
run_for_epochs: 2 | ||
src_file: examples/data/head.ja | ||
trg_file: examples/data/head.en | ||
dev_tasks: | ||
- !LossEvalTask | ||
src_file: examples/data/head.ja | ||
ref_file: examples/data/head.en | ||
train: !SimpleTrainingRegimen | ||
run_for_epochs: 0 | ||
src_file: examples/data/head.ja | ||
trg_file: examples/data/head.en | ||
evaluate: | ||
- !AccuracyEvalTask | ||
eval_metrics: bleu | ||
src_file: examples/data/head.ja | ||
ref_file: examples/data/head.en | ||
hyp_file: examples/output/{EXP}.test_hyp | ||
inference: !AutoRegressiveInference | ||
report_path: examples/output/{EXP}.report | ||
report_type: html, file | ||
reporter: !AttentionHtmlReporter { report_path: 'examples/output/{EXP}.report' } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,20 @@ | ||
report: !Experiment | ||
exp_global: !ExpGlobal | ||
default_layer_dim: 256 | ||
dropout: 0.0 | ||
compute_report: True | ||
model: !DefaultTranslator | ||
src_reader: !PlainTextReader | ||
vocab: !Vocab {vocab_file: examples/data/head.ja.vocab} | ||
trg_reader: !PlainTextReader | ||
vocab: !Vocab {vocab_file: examples/data/head.en.vocab} | ||
src_embedder: !SimpleWordEmbedder | ||
emb_dim: 256 | ||
encoder: !BiLSTMSeqTransducer | ||
layers: 1 | ||
input_dim: 256 | ||
attender: !MlpAttender | ||
state_dim: 256 | ||
hidden_dim: 256 | ||
input_dim: 256 | ||
trg_embedder: !SimpleWordEmbedder | ||
emb_dim: 256 | ||
decoder: !AutoRegressiveDecoder | ||
rnn: !UniLSTMSeqTransducer | ||
layers: 1 | ||
bridge: !NoBridge {} | ||
inference: !AutoRegressiveInference {} | ||
train: !SimpleTrainingRegimen | ||
run_for_epochs: 1 | ||
trainer: !AdamTrainer | ||
alpha: 0.01 | ||
run_for_epochs: 0 | ||
src_file: examples/data/head.ja | ||
trg_file: examples/data/head.en | ||
dev_tasks: | ||
- !LossEvalTask | ||
src_file: examples/data/head.ja | ||
ref_file: examples/data/head.en | ||
evaluate: | ||
- !AccuracyEvalTask | ||
eval_metrics: bleu,wer | ||
src_file: examples/data/head.ja | ||
ref_file: examples/data/head.en | ||
hyp_file: test/tmp/{EXP}.test_hyp | ||
inference: !AutoRegressiveInference | ||
report_path: test/tmp/{EXP}.report | ||
report_type: html, file | ||
reporter: !AttentionHtmlReporter {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.