Skip to content

Commit

Permalink
Fixed incorrectly set default kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
marinkaz committed Jul 20, 2015
1 parent 4d6a695 commit f5847cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions nimfa/methods/factorization/bd.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ def __init__(self, V, seed=None, W=None, H=None, rank=30, max_iter=30,
self.name = "bd"
self.aseeds = ["random", "fixed", "nndsvd", "random_c", "random_vcol"]
nmf_std.Nmf_std.__init__(self, vars())
if self.alpha is not None:
if self.alpha is None:
self.alpha = sp.csr_matrix((self.V.shape[0], self.rank))
self.alpha = self.alpha.tocsr() if sp.isspmatrix(self.alpha) else np.mat(self.alpha)
if self.beta is not None:
if self.beta is None:
self.beta = sp.csr_matrix((self.rank, self.V.shape[1]))
self.beta = self.beta.tocsr() if sp.isspmatrix(self.beta) else np.mat(self.beta)
if self.n_w is not None:
if self.n_w is None:
self.n_w = np.zeros((self.rank, 1))
if self.n_h is not None:
if self.n_h is None:
self.n_h = np.zeros((self.rank, 1))
self.tracker = mf_track.Mf_track() if self.track_factor and self.n_run > 1 \
or self.track_error else None
Expand Down
4 changes: 2 additions & 2 deletions nimfa/methods/factorization/snmnmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ def __init__(self, V, V1, seed=None, W=None, H=None, H1=None,
self.name = "snmnmf"
self.aseeds = ["random", "fixed", "nndsvd", "random_c", "random_vcol"]
nmf_mm.Nmf_mm.__init__(self, vars())
if self.A is not None:
if self.A is None:
self.A = sp.csr_matrix((self.V1.shape[1], self.V1.shape[1]))
self.A = self.A.tocsr() if sp.isspmatrix(self.A) else np.mat(self.A)
if self.B is not None:
if self.B is None:
self.B = sp.csr_matrix((self.V.shape[1], self.V1.shape[1]))
self.B = self.B.tocsr() if sp.isspmatrix(self.B) else np.mat(self.B)
self.tracker = mf_track.Mf_track() if self.track_factor and self.n_run > 1 \
Expand Down

0 comments on commit f5847cc

Please sign in to comment.