-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #887 from YosefLab/model_best_state
Model best state
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from scvi.data import synthetic_iid | ||
from scvi.model import SCVI | ||
from scvi.lightning._callbacks import SaveBestState | ||
|
||
|
||
def test_save_best_state_callback(save_path): | ||
|
||
n_latent = 5 | ||
adata = synthetic_iid() | ||
model = SCVI(adata, n_latent=n_latent) | ||
callbacks = [SaveBestState(verbose=True)] | ||
model.train(3, check_val_every_n_epoch=1, train_size=0.5, callbacks=callbacks) |