Open
Conversation
- assume all modes are given and discard the first - rename to `eigenstrap` - always perform spheroid transform - remove joblib test in test_io.py - refactor eigen.get_eigengroup_inds to take in n_modes as only input argument - update toml to use latest lapy version on github
Other minor changes include: - improve docstrings - fix randomize bug - update uv.lock to include joblib and github version of lapy
Modify lab neuromodes PR NSBLab#13 to simplify dealing with first eigenmode
… is likely to be moved
minor updates
…effs via list comprehension
…ctions + pass seeds for randomization
…f number of nulls is different
… squeeze bug in last line. some minor changes to formatting otherwise
…ence w/ number of nulls/maps
…or reproducibility across different n_nulls in eigenstrap()
Support multi-map eigenstrapping + speed up computation + adjust docs
- Fixed bug when resample="exact" - Improved docstrings and comments - Used resample="exact" in tutorial
…th emodes outside
- Added L and R meylinmap files for fsLR 4k - Updated the L and R medmasks to correctly mask out all medial wall vertices (cortical vertices reduced from 3636 to 3619) - Updated all corresponding tests and test data - Updated nulls.eigenstrap docstring
- Using _eigenstrap_multiple caused "test_internull_corrs" to fail. Therefore, reverted to _eigenstrap_single for now. - Fixed deprecation bug in eigenstrapping_sphere.ipynb
Collaborator
|
why doesnt the nulls sphere PSD match the original any more? |
Collaborator
Author
Looks like I just forgot to rerun that notebook before committing. The PSD looks like that when |
…two functions that can be used to generate rotation matrices. set names of these functions to _rotate_coeffs_qr and _scipy (from _eigenstrap_multiple and _single). change input/output of _rotate_coeffs_scipy (nee _eigenstrap_single) so that it does concatenation internally -- but there should not be any changes to functionality. these can now be called using eigenstrap(..., rotation_method={qr,scipy}). update cortex and sphere notebooks to each use one method (for ongoing testing). all tests pass with both method (_qr is 5-20x faster than _scipy). TODO : compare _scipy results with original eigenstrapping
- Add `eigenstrapping_match_orig.ipynb` to test our implementation matches original - Change `eigenstrapping.ipynb` to use `resample="exact"` - Fix missing import in `test_nulls.py` - Remove jupyter_bokeh from toml
- Update eigenstrap docstring - Exactly match default version of original eigenstrapping in validation notebook - Save original nulls as test data to use for validation notebook and tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nulls.pywith a main functioneigenstrapto generate eigenstrapped nulls. This function uses_eigenstrap_singleto generate each null.eigenstrapas a class method toEigenSolverget_eigengroup_indstoeigen.pyio.pyand removed corresponding test intest_io.pytest_nulls.pyeigenstrapping.ipynbCommit f6f95f1 contains code to exactly match the nulls generated in the original eigenstrapping code by Nikitas Koussis if we need to go back to compare. The key differences include:
add_resandpermuteinto one argumentresidualwhich can either beNone,addorpermuteeigenstrapcleaner. To avoid division by zero in the normalisation, we set the first eigenvalue to be 1. The first mode doesn't get rotated but keeping this in will preserve the mean of the nulls whenresample=None.EigenSolverwhich already does masking. Sinceeigenstrapis a method of that class, adding a masking option ineigenstrapwould lead to conflicts with theEigenSolvermask.normalizeas an option.seedis used to initialize a master random number generator (RNG) that generates an integer seed for each null map. Then each null uses its allocated integer to generate its own RNG to use for all rotations/permutations of that null. This ensures that each null is independent of the number of parallel jobs used.resampleto include multiple options:'match'to match the sorted of the original data,'zscore'to z-score and rescale to original mean std,'mean'to preserve the mean, and'range'to preserve the minimum and maximum. Default isNonefor no resampling.