SURE-tools 3.7.1__tar.gz → 3.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sure_tools-3.7.1 → sure_tools-3.7.3}/PKG-INFO +1 -1
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/SURE_vae.py +7 -32
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE_tools.egg-info/PKG-INFO +1 -1
- {sure_tools-3.7.1 → sure_tools-3.7.3}/setup.py +1 -1
- {sure_tools-3.7.1 → sure_tools-3.7.3}/LICENSE +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/README.md +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/SURE.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/SUREMO.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/SURE_nsf.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/SURE_vanilla.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/__init__.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/atac/__init__.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/atac/utils.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/dist/__init__.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/dist/negbinomial.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/graph/__init__.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/graph/graph_utils.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/utils/__init__.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/utils/custom_mlp.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/utils/label.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/utils/queue.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE/utils/utils.py +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE_tools.egg-info/SOURCES.txt +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE_tools.egg-info/dependency_links.txt +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE_tools.egg-info/requires.txt +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/SURE_tools.egg-info/top_level.txt +0 -0
- {sure_tools-3.7.1 → sure_tools-3.7.3}/setup.cfg +0 -0
|
@@ -256,12 +256,12 @@ class SUREVAE(nn.Module):
|
|
|
256
256
|
)
|
|
257
257
|
|
|
258
258
|
if np.sum(self.condition_sizes)>0:
|
|
259
|
-
self.
|
|
259
|
+
self.condition_effects = nn.ModuleList()
|
|
260
260
|
for condition_size in self.condition_sizes:
|
|
261
|
-
self.
|
|
262
|
-
[condition_size + self.latent_dim] + self.decoder_hidden_layers + [
|
|
261
|
+
self.condition_effects.append(ZeroBiasMLP3(
|
|
262
|
+
[condition_size + self.latent_dim] + self.decoder_hidden_layers + [self.latent_dim],
|
|
263
263
|
activation=activate_fct,
|
|
264
|
-
output_activation=
|
|
264
|
+
output_activation=None,
|
|
265
265
|
post_layer_fct=post_layer_fct,
|
|
266
266
|
post_act_fct=post_act_fct,
|
|
267
267
|
allow_broadcast=self.allow_broadcast,
|
|
@@ -269,20 +269,6 @@ class SUREVAE(nn.Module):
|
|
|
269
269
|
)
|
|
270
270
|
)
|
|
271
271
|
|
|
272
|
-
self.encoder_condition_effects = self.decoder_condition_effects
|
|
273
|
-
'''self.encoder_condition_effects = nn.ModuleList()
|
|
274
|
-
for condition_size in self.condition_sizes:
|
|
275
|
-
self.encoder_condition_effects.append(ZeroBiasMLP3(
|
|
276
|
-
[condition_size + self.latent_dim] + self.decoder_hidden_layers + [[self.latent_dim,self.latent_dim]],
|
|
277
|
-
activation=activate_fct,
|
|
278
|
-
output_activation=[None,Exp],
|
|
279
|
-
post_layer_fct=post_layer_fct,
|
|
280
|
-
post_act_fct=post_act_fct,
|
|
281
|
-
allow_broadcast=self.allow_broadcast,
|
|
282
|
-
use_cuda=self.use_cuda,
|
|
283
|
-
)
|
|
284
|
-
)'''
|
|
285
|
-
|
|
286
272
|
if self.covariate_size>0:
|
|
287
273
|
self.covariate_effect = ZeroBiasMLP2(
|
|
288
274
|
[self.covariate_size] + self.decoder_hidden_layers + [self.latent_dim],
|
|
@@ -424,10 +410,7 @@ class SUREVAE(nn.Module):
|
|
|
424
410
|
shift = 0
|
|
425
411
|
for i, condition_size in enumerate(self.condition_sizes):
|
|
426
412
|
cs_i = cs[:,shift:(shift+condition_size)]
|
|
427
|
-
|
|
428
|
-
zcs_i = pyro.sample(f'zcs_{i}', dist.Normal(l, s).to_event(1))
|
|
429
|
-
#zcs += self.condition_effects[i]([cs_i,zns])
|
|
430
|
-
zcs += zcs_i
|
|
413
|
+
zcs += self.condition_effects[i]([cs_i,zns])
|
|
431
414
|
shift += condition_size
|
|
432
415
|
else:
|
|
433
416
|
zcs = torch.zeros_like(zs)
|
|
@@ -475,13 +458,6 @@ class SUREVAE(nn.Module):
|
|
|
475
458
|
|
|
476
459
|
zn_loc, zn_scale = self.encoder_zn(xs)
|
|
477
460
|
zns = pyro.sample('zn', dist.Normal(zn_loc, zn_scale).to_event(1))
|
|
478
|
-
|
|
479
|
-
shift = 0
|
|
480
|
-
for i, condition_size in enumerate(self.condition_sizes):
|
|
481
|
-
cs_i = cs[:,shift:(shift+condition_size)]
|
|
482
|
-
l,s = self.encoder_condition_effects[i]([cs_i,zns])
|
|
483
|
-
zcs_i = pyro.sample(f'zcs_{i}', dist.Normal(l, s).to_event(1))
|
|
484
|
-
shift += condition_size
|
|
485
461
|
|
|
486
462
|
#alpha = self.encoder_n(zns)
|
|
487
463
|
alpha = self.encoder_alpha(zns)
|
|
@@ -627,7 +603,7 @@ class SUREVAE(nn.Module):
|
|
|
627
603
|
C_batch = cs[idx].to(self.get_device())
|
|
628
604
|
|
|
629
605
|
z_basal = self._get_cell_embedding(X_batch)
|
|
630
|
-
dzs
|
|
606
|
+
dzs = self.condition_effects[i]([C_batch,z_basal])
|
|
631
607
|
|
|
632
608
|
A.append(tensor_to_numpy(dzs))
|
|
633
609
|
pbar.update(1)
|
|
@@ -671,8 +647,7 @@ class SUREVAE(nn.Module):
|
|
|
671
647
|
shift = 0
|
|
672
648
|
for i, condition_size in enumerate(self.condition_sizes):
|
|
673
649
|
C_batch_i = C_batch[:, shift:(shift+condition_size)]
|
|
674
|
-
|
|
675
|
-
zcs += zcs_i
|
|
650
|
+
zcs += self.condition_effects[i]([C_batch_i,z_basal])
|
|
676
651
|
shift += condition_size
|
|
677
652
|
|
|
678
653
|
zfs = torch.zeros_like(z_basal)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|