Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix register_fields bug in tuner and add dependencies #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chelseabright96
Copy link

Fixed register_fields bug in tuner:

  • fixed error where registry was being transferred without existing source registry
    Added dependencies and fixed compatibility issue with scipy

Comment on lines +598 to 610
# getattr(experiment.model_cls, experiment.setup_method_name)(
# experiment.data,
# # **experiment.setup_method_args,
# )
experiment.model_cls.setup_anndata(experiment.data, **setup_anndata_kwargs)

model = experiment.model_cls(experiment.data, **model_args)
model.train(max_epochs=train_args.pop("max_epochs",2000),
use_gpu=train_args.pop("use_gpu",True),
early_stopping_patience=train_args.pop("early_stopping_patience",10),
check_val_every_n_epoch=train_args.pop("check_val_every_n_epoch",5),
plan_kwargs=plan_kwargs,
**train_args)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have this section similar to the part above it?
Eventually, something like this I think:

Suggested change
# getattr(experiment.model_cls, experiment.setup_method_name)(
# experiment.data,
# # **experiment.setup_method_args,
# )
experiment.model_cls.setup_anndata(experiment.data, **setup_anndata_kwargs)
model = experiment.model_cls(experiment.data, **model_args)
model.train(max_epochs=train_args.pop("max_epochs",2000),
use_gpu=train_args.pop("use_gpu",True),
early_stopping_patience=train_args.pop("early_stopping_patience",10),
check_val_every_n_epoch=train_args.pop("check_val_every_n_epoch",5),
plan_kwargs=plan_kwargs,
**train_args)
adata = experiment.data.copy()
if sub_sample is not None:
sc.pp.subsample(adata, fraction=sub_sample)
experiment.model_cls.setup_anndata(adata, **setup_anndata_kwargs)
model = experiment.model_cls(adata, **model_args)
model.train(plan_kwargs=plan_kwargs, **train_args)
del adata
import gc
gc.collect()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants