From 80cf42e33b83490f9bb81c63c85bb8409d35cebb Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 25 May 2017 17:15:39 -0500 Subject: [PATCH] Fix compounding and decaying utils --- spacy/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 54a6d17b5..c0768ff23 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -326,7 +326,7 @@ def compounding(start, stop, compound): >>> assert next(sizes) == 1.5 * 1.5 ''' def clip(value): - return max(value, stop) if (start>stop) else min(value, start) + return max(value, stop) if (start>stop) else min(value, stop) curr = float(start) while True: yield clip(curr) @@ -336,7 +336,7 @@ def compounding(start, stop, compound): def decaying(start, stop, decay): '''Yield an infinite series of linearly decaying values.''' def clip(value): - return max(value, stop) if (start>stop) else min(value, start) + return max(value, stop) if (start>stop) else min(value, stop) nr_upd = 1. while True: yield clip(start * 1./(1. + decay * nr_upd))