scvi-tools icon indicating copy to clipboard operation
scvi-tools copied to clipboard

Autotune with Ray Tune

Open adamgayoso opened this issue 4 years ago • 2 comments

It should be relatively straightforward to create a new autotune module with Ray tune.

adamgayoso avatar Mar 04 '21 18:03 adamgayoso

@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)

adamgayoso avatar Mar 10 '21 01:03 adamgayoso

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

mjayasur avatar Mar 26 '21 17:03 mjayasur

Closing issue because of #1565.

martinkim0 avatar Sep 23 '22 22:09 martinkim0