Pre-defined validation data

I am training multiple models and have pre-existing h5ad files corresponding to train/test/validation datasets that are fixed across the models. Is there a way to manually set the train and validation anndata objects when training an scvi.model.SCVI model? I see that there is a setter for validation_indices, is the best way to just concatenate the two anndata objects and then manually set validation_indices?

My idea solution would look something like this:

model = scvi.model.SCVI(train_adata, val_adata, n_layers=n_layers, n_latent=n_latent, n_hidden=n_hidden, gene_likelihood="nb")

but I’m not sure that this would be a broadly applicable change for other users.

Hi, yes concatenating and setting validation indices is the correct way (only works in the current main branch and will be released for 1.2). ScVI-tools requires a single AnnData object. We are working with other group to lift this restrictions.