-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Hello, I've set the seed code as shown below before executing the Spoint.init_model, spoint.train, and spoint.deconv_spatial() functions in my Python script. However, after repeatedly running the script, I noticed that the deconvolution results aren't entirely consistent, with around 20% of the cells differing in identity. How can I resolve this reproducibility issue with the deconvolution?
====================================
import random
import numpy as np
random.seed(42)
np.random.seed(42)
torch.manual_seed(42)
torch.cuda.manual_seed(42)
torch.cuda.manual_seed_all(42)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
====================================
spoint = Spoint.init_model(sc_ad, st_ad, celltype_key=f"{celltype_index}",sm_size=200000, n_threads=20, use_gpu=use_gpu)
spoint.train(max_steps=10000, batch_size=1024,early_stop=True)
pre = spoint.deconv_spatial()
st_ad = spoint.st_ad
st_ad.write(f"Spiont_{sample_id}.h5ad")