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)