Skip to content

Commit 58a3642

Browse files
authored
Update notes on VAMP prior component change
1 parent 4e7b559 commit 58a3642

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

notebooks/tryout/xxjoint_vampprior.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,15 @@ def sample_prior(prior, batch_size):
762762
del embed_sub
763763

764764
# %% [markdown]
765-
# ### cVAE - change of pseudoinputs over training
765+
# ### VAMP - change of pseudoinputs over training
766766

767767
# %%
768768
pis=[]
769769
model = XXJointModel(adata=adata_training, prior='vamp', n_prior_components=100,
770770
pseudoinputs_data_init=True)
771771
pis.append([model.module.prior.u.detach().cpu().numpy(),
772772
model.module.prior.u_cov.detach().cpu().numpy()])
773+
# Train for 1 epoch and see how PIs migrate
773774
for i in range(20):
774775
model.train(max_epochs=1,
775776
check_val_every_n_epoch=1,
@@ -786,6 +787,7 @@ def sample_prior(prior, batch_size):
786787
model.module.prior.u_cov.detach().cpu().numpy()])
787788

788789
# %%
790+
# PIs are on level of data - thus they must be encoded to get them to latent space
789791
pis_z=[model.module.encoder(x=torch.tensor(x,device=model.module.device),
790792
cov=torch.tensor(cov,device=model.module.device)
791793
)['y_m'].detach().cpu().numpy()
@@ -808,7 +810,7 @@ def sample_prior(prior, batch_size):
808810
embed_sub.obs['species']=embed_sub.obs.system.map({0:'mm',1:'hs'})
809811

810812
# %%
811-
# Pseudoinput and data sub embedding
813+
# Pseudoinput and data sub joint embedding
812814
embed_sub_pin = sc.concat([embed_sub,embed_pis],
813815
merge='unique', join='outer')
814816
embed_sub_pin.obs['input_type']=['expr']*embed_sub.shape[0]+\

0 commit comments

Comments
 (0)