mypackage.MyModel.load¶
-
classmethod
MyModel.
load
(dir_path, adata=None, use_gpu=None)¶ Instantiate a model from the saved output.
- Parameters
- dir_path :
str
str
Path to saved outputs.
- adata :
AnnData
|None
Optional
[AnnData
] (default:None
) AnnData organized in the same way as data used to train model. It is not necessary to run
setup_anndata()
, as AnnData is validated against the saved scvi setup dictionary. If None, will check for and load anndata saved with the model.- use_gpu :
str
|int
|bool
|None
Union
[str
,int
,bool
,None
] (default:None
) Load model on default GPU if available (if None or True), or index of GPU to use (if int), or name of GPU (if str), or use CPU (if False).
- dir_path :
- Returns
Model with loaded state dictionaries.
Examples
>>> vae = SCVI.load(save_path, adata) >>> vae.get_latent_representation()