From 74d5c625b320a20c131a2c465921ad6fa9b9249b Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 16 May 2018 20:11:59 +0200 Subject: [PATCH] Use rising beam update prob --- spacy/cli/ud_train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/cli/ud_train.py b/spacy/cli/ud_train.py index d3620c004..68fedbbbf 100644 --- a/spacy/cli/ud_train.py +++ b/spacy/cli/ud_train.py @@ -370,7 +370,7 @@ def main(ud_dir, parses_dir, config, corpus, limit=0, use_gpu=-1, vectors_dir=No optimizer = initialize_pipeline(nlp, docs, golds, config, use_gpu) batch_sizes = compounding(config.batch_size//10, config.batch_size, 1.001) - nlp.parser.cfg['beam_update_prob'] = 1.0 + beam_prob = compounding(0.2, 0.8, 1.001) for i in range(config.nr_epoch): docs, golds = read_data(nlp, paths.train.conllu.open(), paths.train.text.open(), max_doc_length=config.max_doc_length, limit=limit, @@ -385,6 +385,7 @@ def main(ud_dir, parses_dir, config, corpus, limit=0, use_gpu=-1, vectors_dir=No for batch in batches: batch_docs, batch_gold = zip(*batch) pbar.update(sum(len(doc) for doc in batch_docs)) + nlp.parser.cfg['beam_update_prob'] = next(beam_prob) nlp.update(batch_docs, batch_gold, sgd=optimizer, drop=config.dropout, losses=losses)