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

Where is the tutorial of 3D reconstruction with pairwise alignment? #292

Open
waniwal opened this issue Nov 25, 2024 · 6 comments
Open

Where is the tutorial of 3D reconstruction with pairwise alignment? #292

waniwal opened this issue Nov 25, 2024 · 6 comments

Comments

@waniwal
Copy link

waniwal commented Nov 25, 2024

The tutorial of 3D reconstruction with pairwise alignment is not found.

@YifanLu2000
Copy link
Contributor

Hi, thank you very much for your interest! We will update the tutorial as soon as possible to provide a smoother, more detailed, and comprehensive guide for users. However, as I have been quite busy these days and would like to make the tutorial as perfect as possible, there has been some delay. We expect to release the related tutorial this week and hope you can understand.

@yuling999666
Copy link

Hi @YifanLu2000, I would like to ask how can I reproduce the result of pairwise alignment since you have multiple randomness generator in your st.align.morph_align () function. I tried to set seed out of the function but I cannot generate the same result. Could you give some suggestions? Thanks.

@YifanLu2000
Copy link
Contributor

Hi @yuling999666, I believe there are two sources of randomness in st.align.morph_align: one is the SVI process, and the other is the selection of inducing points, which are generated by torch.roll (when using GPU) and np.random.choice, respectively. Could you try setting the seed for both PyTorch and NumPy to see if that resolves the issue?

@yuling999666
Copy link

Hi @YifanLu2000 , thank you for your reply. It seems that you have used np.random.choice() multiple times in the morpho_pairwise(). If I just set seed before applying st.align.morph_align(), the first np.random.choice() will use my seed, but the second, the third one... will not. I think it's not decent to copy your code and change it inside the package. I have stuck in it for a long time... still figuring out how to do it.

@YifanLu2000
Copy link
Contributor

Hi @yuling999666, after my attempts, I found that setting the random seed for PyTorch and NumPy before the function can ensure consistent results for each run. However, it’s important to note that this needs to be done alongside the execution of st.align.morpho_align. You can add the following two lines before calling st.align.morpho_align:

np.random.seed(42)
torch.manual_seed(42)
aligned_slices, _= st.align.morpho_align(...)

@yuling999666
Copy link

Hi @YifanLu2000 , thanks for reply. I appreciate it. I can generate the same results using the same conda environment, but when I change to another conda environment, it changes. I'm still trying to figure out if it's due to computer or server not the code itself.

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

No branches or pull requests

3 participants