scvi-tools
scvi-tools copied to clipboard
Autotune with Ray Tune
@mjayasur and I discussed this on slack, but an acceptable initial API might do the following
auto = Autotune(adata, scvi.model.SCVI, name=name)
# set config
auto.set_hyperparam_space(dict(lr=...))
# set callback
auto.track_metrics(metrics_dict)
auto.add_scheduler(scheduler)
auto.add_reporter(reporter)
# runs tune.run
auto()
which could then be wrapped with functions like
# wraps code snippet above
best_model_instance = autotune_scvi(adata, hyperparm_space: Optional[dict] = None, scheduler=None, reporter=None)
dummy metric function:
- do something dumb
silhouette metric function:
- get latent representation from model
- scanpy neighbors
- scanpy leiden cluster
- get the leiden, then compute the silhouette with respect to the latent representation
Closing issue because of #1565.