Skip to content

Commit

Permalink
Fix an inference issue under 'memory' mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff1995 committed Mar 27, 2019
1 parent 6333ef4 commit d76c8d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cell_BLAST/directi.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def inference(self, x, batch_size=4096, noisy=0, progress_bar=False,
priority = "memory" if x.shape[0] > 1e5 else "speed"
if priority == "speed":
xrep = [x] * noisy
if scipy.sparse.issparse(x[0]):
if scipy.sparse.issparse(x):
xrep = scipy.sparse.vstack(xrep)
else:
xrep = np.vstack(xrep)
Expand All @@ -440,8 +440,9 @@ def inference(self, x, batch_size=4096, noisy=0, progress_bar=False,
return np.stack(np.split(lrep, noisy), axis=1)
else: # priority == "memory":
return np.stack([self._fetch(
self.latent, x, batch_size, True, progress_bar, random_seed
) for _ in range(noisy)], axis=1)
self.latent, x, batch_size, True, progress_bar,
(random_seed + i) if random_seed is not None else None
) for i in range(noisy)], axis=1)
return self._fetch(self.latent, x, batch_size, False, progress_bar)

def clustering(self, x, batch_size=4096, progress_bar=True):
Expand Down

0 comments on commit d76c8d8

Please sign in to comment.