Skip to content

Commit

Permalink
fixing test model function
Browse files Browse the repository at this point in the history
  • Loading branch information
ivichadriana committed Aug 12, 2024
1 parent 118b426 commit 468ed7b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
def test_VAEmodel():
n_latent = 5
adata = synthetic_iid()
VAEModel.setup_anndata(adata, batch_key="batch", labels_key="labels", adata_obs="labels")
adata = VAEModel.use_obs(adata, labels_key="labels_key", adata_obs=["batch", "labels"])
adata_manager, adata = VAEModel.setup_anndata(adata, labels_key="labels_key", batch_key="batch")

print("Model Initiated..")

model = VAEModel(adata, n_latent=n_latent, n_layers=10)
model.train(max_epochs=5)
model.get_elbo()
model.get_latent_representation()
model.get_marginal_ll(n_mc_samples=5)
model.get_reconstruction_error()
print("ELBO:", model.get_elbo())
print("Latent Representation:", model.get_latent_representation)

# tests __repr__
print(model)
print("\nSuccess!..")


test_VAEmodel()
adata = test_VAEmodel()

0 comments on commit 468ed7b

Please sign in to comment.