Skip to content

Conversation

@j-c-c
Copy link
Collaborator

@j-c-c j-c-c commented Oct 27, 2022

This PR adds the common lines method for Cn Symmetric molecules, n>4.

@j-c-c j-c-c self-assigned this Oct 27, 2022
@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Merging #733 (c8a04f9) into develop (e9d5e91) will increase coverage by 0.60%.
The diff coverage is 98.88%.

@@             Coverage Diff             @@
##           develop     #733      +/-   ##
===========================================
+ Coverage    88.69%   89.29%   +0.60%     
===========================================
  Files          116      118       +2     
  Lines         9440    10634    +1194     
===========================================
+ Hits          8373     9496    +1123     
- Misses        1067     1138      +71     
Impacted Files Coverage Δ
src/aspire/utils/__init__.py 100.00% <ø> (ø)
src/aspire/abinitio/commonline_cn.py 98.60% <98.60%> (ø)
src/aspire/abinitio/__init__.py 100.00% <100.00%> (ø)
src/aspire/abinitio/commonline_c3_c4.py 97.32% <100.00%> (+0.03%) ⬆️
src/aspire/utils/matrix.py 98.87% <100.00%> (+0.06%) ⬆️
src/aspire/utils/misc.py 90.16% <100.00%> (-2.63%) ⬇️

... and 13 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@j-c-c j-c-c added the enhancement New feature or request label Nov 30, 2022
j-c-c and others added 25 commits January 5, 2023 08:53
@j-c-c
Copy link
Collaborator Author

j-c-c commented Mar 10, 2023

Member

It definitely has some visual appeal. In the related publication this molecule is only used to generate simulated data, but it might be good to add to have some more cyclically symmetric molecules with order > 4.

@garrettwrong
Copy link
Collaborator

It definitely has some visual appeal. In the related publication this molecule is only used to generate simulated data, but it might be good to add to have some more cyclically symmetric molecules with order > 4.

Cool, I generally just want to continually keep track of any molecules we are using so it isn't a guessing game for future developers/researchers :).

@j-c-c
Copy link
Collaborator Author

j-c-c commented Mar 10, 2023

It definitely has some visual appeal. In the related publication this molecule is only used to generate simulated data, but it might be good to add to have some more cyclically symmetric molecules with order > 4.

Cool, I generally just want to continually keep track of any molecules we are using so it isn't a guessing game for future developers/researchers :).

Added to the target dataset list.

Copy link
Collaborator

@janden janden left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together. Some comments and questions here.

@j-c-c
Copy link
Collaborator Author

j-c-c commented Mar 21, 2023

Follow up on reconstruction pipelines. I ran an A/B test on the initial code and after first refactor. Appears to be performing well. I will run one more reconstruction with the code in its current state and follow up.

The initial reconstruction (prior to Garrett's review) was using 500 images with a low level of noise generated from the volume map of this C11 molecule.
Screen Shot 2023-03-21 at 8 27 13 AM

A subsequent reconstruction was performed after significant refactor. The refactor included; restriction of "equator" candidate rotations during generation, using synchronized-mean to estimate viis, and all_pairs optimization.

In order to replicate the conditions of the initial reconstruction I supplied the same candidate rotations to the refactored algorithm (414 out of 500 of the initial candidates were non-equator candidates). Here is that reconstruction:
Screen Shot 2023-03-21 at 8 43 26 AM

@j-c-c
Copy link
Collaborator Author

j-c-c commented Mar 21, 2023

@janden Thanks for the review! I've addressed all your questions/comments so it's in a good place for you to take another look. Thanks!

@j-c-c j-c-c requested a review from janden March 21, 2023 12:49
@garrettwrong
Copy link
Collaborator

Follow up on reconstruction pipelines. I ran an A/B test on the initial code and after first refactor. Appears to be performing well. I will run one more reconstruction with the code in its current state and follow up.

Very nice Josh!

Comment on lines +154 to +166
corrs = corrs_ij[cijs_inds[..., 0], cijs_inds[..., 1]]
corrs = np.reshape(
corrs,
(
self.n_points_sphere,
self.n_points_sphere,
self.order,
n_theta_ijs // self.order,
),
)

# Take the mean over all symmetry induced common lines.
corrs = np.mean(corrs, axis=-2)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@janden I misspoke during the dev meeting regarding candidate rotations and just wanted to correct myself here.

In this section we arrange the correlation between pairwise images based on the common line indices, cijs_inds, induced by the candidate rotations. These common line indices are formed using the relative rotation Ris_tilde[i].T @ R_theta_ijs @ Ris_tilde[j], Where Ris_tilde are arbitrary candidate rotations in SO(3) and R_theta_ijs is the set of in-plane rotations about the z-axis, [0, 2pi). The true relative rotation between pairwise images is Ri.T @ gs @ Rj, where gs is an in-plane rotation about the axis of symmetry (z-axis) by 2pi/order to some power s. We need to find an in-plane rotation R_theta_ijs that best approximates gs for any s (there will be exactly self.order of them). Since we don't care which in-plane rotation we find we can reduce the search, in this case by taking the mean on line 166. This effectively reduces our search space from SO(3) to what is called SOn(3) in the paper. To be clear, the reduction to SOn(3) does not place the remaining candidate rotations in a single wedge of the sphere, but just reduces the candidates that are in redundant parts of the sphere (ie. symmetric locations), they will still be spread throughout SO(3).

This is why we are still able to perform a reconstruction with out symmetry boosting.

@j-c-c
Copy link
Collaborator Author

j-c-c commented Mar 24, 2023

@janden, I fixed the argmax issue we discussed. So this is in a good place for you to take another look. Thanks!

@janden
Copy link
Collaborator

janden commented Mar 29, 2023

@j-c-c Just a few more things, then we should be good to go.

@j-c-c j-c-c merged commit edfbd09 into develop Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants