From b144de77aa7a5100bb81ef895cd01351ab93df1a Mon Sep 17 00:00:00 2001 From: Timofey Yefimov Date: Wed, 30 Jan 2019 22:03:32 +0300 Subject: [PATCH] [skip ci] Fix error computation --- gensim/models/nmf.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gensim/models/nmf.py b/gensim/models/nmf.py index 18a0ed97d5..d312e22ce3 100644 --- a/gensim/models/nmf.py +++ b/gensim/models/nmf.py @@ -193,7 +193,7 @@ def __init__( self._W = None self.w_std = None - self._w_error = None + self._w_error = np.inf self._h = None @@ -561,8 +561,6 @@ def update(self, corpus): chunk_idx = 1 - prev_w_error = np.inf - for _ in range(self.passes): for chunk in utils.grouper(corpus, self.chunksize, as_numpy=False): self.random_state.shuffle(chunk)