Replies: 1 comment 6 replies
-
Hi @chunyueli , thanks for using CEBRA! implementationImplementing seeding has been on the roadmap, but is not fully done yet. Several classes in CEBRA inherit from the The minimal implementation would be to consider seeding,
If you are interested in working on this, I would be happy to go back and forth over the required changes. regarding your datasetYour dataset presents an additional special case. It seems like your embedding is broken into two parts. The consistency guarantee then does not apply to the whole embedding, but only to the two subparts. Consistency on the whole embedding requires that the ground truth latent space is connected. If this is a dataset question more than a seeding Q, also happy to follow up on this. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for developing such useful tools.
We are currently using the Cebra model to obtain neural embeddings from calcium neural activity data, and we are pleased with the results. We would like to include the embedding figures in our paper. To ensure the results are reproducible, I set a seed using the following code before creating the Cebra model, and I also set a seed for splitting the training and testing datasets. However, I noticed that the embeddings still vary across runs.
I understand that the Cebra model has inherent consistency, and from your perspective, setting an additional seed may not provide any added benefit. However, we hope to generate same embeddings to avoid unnecessary confusion when reviewers run our code. Could you please provide any guidance on how to correctly set the seed to control randomness and ensure reproducibility? Thank you.
I apologize for raising this topic again. I know similar questions have been asked. I’ve opened a new issue hoping for a quick response due to an upcoming deadline. Thank you for your understanding, and sorry for any inconvenience.
Code:
def set_seed(seed, device_id='cuda:0'):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
if torch.cuda.is_available():
torch.cuda.set_device(device_id)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
Below are the embeddings for the same dataset across runs:
Beta Was this translation helpful? Give feedback.
All reactions