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

Weighted Volumes #406

Merged
merged 10 commits into from
Jul 13, 2023
Merged

Weighted Volumes #406

merged 10 commits into from
Jul 13, 2023

Conversation

garrettwrong
Copy link
Collaborator

Related to #405 .

Stubbing in the weighted volume code. Currently this is just extending the existing volume estimation codes with two sub-classes, mainly to shake out any issues or missing content bringing the feature over to Python.

There is either a tolerance or determinism issue I hope to narrow down on today. Other than that it is able to reproduce an array of r volumes given uniform n-by-r matrix of 1/sqrt(n) weights like we discussed last meeting.

We should probably make sure the python code (including the unweighted codes..) actually does what it is supposed to do before I spend time on next steps/documenting. For example, we discussed potentially making the parent class generalized (weighted) and instead sub class the unweighted code as a special (child) case once things are working. Before we do that sort of work it might be good to reproduce some of the Matlab results...

This seems like a good place to sanity check.

@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

Merging #406 (fad6610) into develop (d20fd99) will decrease coverage by 0.03%.
The diff coverage is 89.88%.

@@             Coverage Diff             @@
##           develop     #406      +/-   ##
===========================================
- Coverage    88.75%   88.73%   -0.03%     
===========================================
  Files          121      121              
  Lines        10676    10762      +86     
===========================================
+ Hits          9476     9550      +74     
- Misses        1200     1212      +12     
Impacted Files Coverage Δ
src/aspire/reconstruction/kernel.py 74.35% <76.00%> (-3.42%) ⬇️
src/aspire/reconstruction/estimator.py 92.68% <80.00%> (+0.57%) ⬆️
src/aspire/volume/volume.py 93.38% <83.33%> (-0.23%) ⬇️
src/aspire/reconstruction/mean.py 96.55% <96.19%> (-3.45%) ⬇️
src/aspire/covariance/covar.py 88.18% <100.00%> (ø)
src/aspire/operators/filters.py 95.75% <100.00%> (+0.04%) ⬆️
src/aspire/reconstruction/__init__.py 100.00% <100.00%> (ø)
src/aspire/source/image.py 92.13% <100.00%> (+0.02%) ⬆️

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

@garrettwrong
Copy link
Collaborator Author

Rebased with latest develop.

After some consideration of the axis ordering I was able to get a reasonably positive comparison between the MATLAB workspace data and this changeset. Notebook attached.

There are still some differences in high frequency, but I think that is minor differences in the 3D reconstruction itself, along with my very crude comparison, and not due to this feature/changeset.

I am going to move forward with trying to refactor the class structure such that the single volume case is the subclass.

Benchmark_Data_Import_comparison.pdf

@garrettwrong
Copy link
Collaborator Author

stashed notebook in my fork (tutorials/notebooks/Benchmark_Data_Import-refactor.ipynb)

https://github.com/garrettwrong/ASPIRE-Python/tree/wts-nb

@garrettwrong
Copy link
Collaborator Author

@janden , I still want to check the scaling and add some notes regarding the references we spoke about, but if you want to take a cursory review of the draft while I'm away that might save some turnaround time when I return. I'm sure there are things to change...

@garrettwrong
Copy link
Collaborator Author

garrettwrong commented Oct 7, 2021

Updated notebook comparing the MATLAB Benchmark data and Python implementation can be found here:

https://github.com/garrettwrong/ASPIRE-Python/blob/c4a5ef76d6d8e43871e37622f49ec325595557d0/tutorials/notebooks/Benchmark_Data_Import-refactor.ipynb

It is not included in this PR due to size. There is a fresh issue created to construct a gallery style tutorial once all the supporting code has melded into develop.

@garrettwrong
Copy link
Collaborator Author

Rebased this with the latest develop. I think we generally need those numpy dtype updates for the pip upgraded (-dev) CI envs.

@garrettwrong
Copy link
Collaborator Author

Just refreshing this guy, a CI change took effect.

@garrettwrong garrettwrong marked this pull request as ready for review November 14, 2022 12:57
@garrettwrong
Copy link
Collaborator Author

Moving to v0.11.1. Should be a good time to work through this review since I will be stuck on basis/cov dev for a while.

I will update the code again after the v0.11.0 release.

@garrettwrong
Copy link
Collaborator Author

Revived this at v0.11.0. Because it was mostly just merge updates I squashed it down.

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.

Merry Christmas!

src/aspire/reconstruction/mean.py Outdated Show resolved Hide resolved
src/aspire/reconstruction/kernel.py Show resolved Hide resolved
src/aspire/reconstruction/kernel.py Outdated Show resolved Hide resolved
src/aspire/reconstruction/kernel.py Show resolved Hide resolved
src/aspire/reconstruction/kernel.py Outdated Show resolved Hide resolved
src/aspire/reconstruction/mean.py Outdated Show resolved Hide resolved
src/aspire/reconstruction/mean.py Outdated Show resolved Hide resolved
src/aspire/reconstruction/mean.py Outdated Show resolved Hide resolved
src/aspire/reconstruction/mean.py Show resolved Hide resolved
src/aspire/reconstruction/mean.py Outdated Show resolved Hide resolved
this branch was mostly just merge updates at this point.
string replacement and comments
@garrettwrong
Copy link
Collaborator Author

@janden , thanks again for the review. Other than the convolve_volume issue where I had a question, I think I've incorporated all the suggestions.

@garrettwrong garrettwrong requested a review from janden July 3, 2023 16:33
@janden
Copy link
Collaborator

janden commented Jul 12, 2023

Almost there!

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.

🎉

@garrettwrong
Copy link
Collaborator Author

Yay! 🧟

@garrettwrong garrettwrong merged commit e308807 into develop Jul 13, 2023
@garrettwrong garrettwrong deleted the wts branch July 13, 2023 17:55
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.

weights (het3d wts)
3 participants