First of all thank you for developing this very useful tool!
I’m currently comparing a model I’ve developed with the original scVI-model but I’m not getting the same results every time I run the scVI-model.
My code for testing the robustness looks something like this:
for _ in range(K): _setup_anndata(train_i, labels_key="labels") _setup_anndata(test_i, labels_key="labels") model_ = model.SCVI(adata=train_i, n_hidden=128, n_layers=1) model_.train(lr=0.0004) latent = model_.get_latent_representation() labels_pred = KMeans(9, n_init=200, random_state=settings.seed).fit_predict(latent)
My expectation is to get the same results for each iteration of this for-loop.
What I have checked:
- Random seed is enabled and the same for each run
- Data is copied with deepcopy() and not modified during training/testing
Is it expected behavior that the model should produce the exact same results, for the same data/initialization/computer_architecture?