-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
Description
get_searchlight_RDMs
is very convenient when working with fMRI datasets, but a few small changes would make it easier for me to use, and might benefit others. As things stand, I basically wrote my own version of it, which is almost 100% identical to upstream. I am aware of the efforts in PR #253 whence this issue instead of a PR with my small changes.
There are two things that I would happily add because I use/need them:
calc_rdm
takes more arguments thanget_searchlight_RDMs
does, making the later less flexible than the former, e.g. I needed to pass acv_descriptor
when usingcrossnobis
distance, butget_searchlight_RDMs
cannot handle that. Same withnoise
,prior_lambda
andprior_weight
. Adding them toget_searchlight_RDMs
could be useful, possibly with**kwargs
?- Parallelizing over
chunks
seems easy and reasonable, esp. as the searchlight util functions already make use of joblib's parallel. I did it by turningfor chunks in tqdm(chunked_center, desc='Calculating RDMs...'):
into a function likedef chunk_to_rdm(chunk):
, then called withRDM_corrs = Parallel(n_jobs=-1)(delayed(chunk_to_rdm)(chunk) for chunk in track(chunked_center))
followed by
for chunks, RDM_corr in zip(chunked_center, RDM_corrs):
RDM[chunks, :] = RDM_corr.dissimilarities
I'd be happy to add these two changes (I have already added them locally to what I'm running, but this makes sharing my code with others harder), and would happily upstream them if it's considered useful.
hippocampeli