-
Notifications
You must be signed in to change notification settings - Fork 58
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
[FIX] Restructure Peaks2MapsKernel to operate like other kernels #410
Conversation
The jobs are being killed, which means that I need to take a look at them and see if I can reduce the computational load. |
Looks like _compute_null_analytic for the ALE estimator is a source of the increased memory consumption. NiMARE/nimare/meta/cbma/ale.py Lines 147 to 151 in 5927613
ALE has 100s of non-zero histogram bins, whereas p2m has 1000s of non-zero bins, creating the variables A potential solution could be to save those variables with single precision (i.e., float32) as opposed to double precision (float64) if there are more than say 2000
so this may not be a good solution. Another potential solution is to turn off/skip tests for ale(analytic)+p2m_kernel since they take too much RAM. |
Our I can't fully explain the differences, but if anything I think that float32 is more accurate. If we have a EDIT: Unfortunately, it looks like numpy's float classes seem to have precision issues that throw the results of import numpy as np
np.min_scalar_type(0.9999)
# dtype('float16')
1 - 0.9999 == 0
# False (correct)
np.float16(1 - 0.9999) == 0
# False (correct)
0.9999 == 1
# False (correct)
np.float16(0.9999) == 1
# True (wrong) Since |
I'm just going to excise all precision-related changes and drop Peaks2MapsKernel from the performance tests. We should open a new issue about the problem, though. |
The docs build is failing, but I don't think that's tied to changes in this PR (see #418), so I am going to merge if all other tests pass. |
@@ -384,6 +384,7 @@ def download_peaks2maps_model(data_dir=None, overwrite=False, verbose=1): | |||
url = "https://zenodo.org/record/1257721/files/ohbm2018_model.tar.xz?download=1" | |||
|
|||
temp_dataset_name = "peaks2maps_model_ohbm2018__temp" | |||
data_dir = _get_dataset_dir("", data_dir=data_dir, verbose=verbose) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #347.
Changes proposed in this pull request:
Peaks2MapsKernel
to follow theKernelTransformer
convention.compute_ma
tocompute_ale_ma
to match convention.peaks2maps
tocompute_p2m_ma
to match convention.Peaks2MapsKernel
intest_estimator_performance.py
(see Peaks2MapsKernel+ALE is too memory-intensive for tests #417).