Repository navigation
Distributed searchlight - #148
Conversation
|
Please provide more comments to describe at least the public methods. I found it a bit confused when reading the code now. For example, I am lost when trying to understand how the ownership is distributed. |
| from brainiak.searchlight.searchlight import Searchlight | ||
|
|
||
| """Distributed Searchlight Example | ||
| """ |
There was a problem hiding this comment.
Document the way this code supposed is supposed to be executed.
| self.max_blk_edge = max_blk_edge | ||
|
|
||
| def _get_ownership(self, data): | ||
| """Determine which processes own each subject |
| In the case of a 3D array, a 3D subarray at the block location | ||
|
|
||
| In the case of a 4D array, a 4D subarray at the block location, | ||
| including the entire 0th dimension. |
| ---------- | ||
|
|
||
| sl_rad: radius, in voxels, of the sphere inscribed in the | ||
| searchlight cube |
There was a problem hiding this comment.
Does this include the center or not?
|
|
||
| subj: list of 4D arrays containing data for one or more subjects. | ||
| Each entry of the list must contaion a 4D array on only one | ||
| MPI rank, and "None" on all other ranks. |
There was a problem hiding this comment.
Aren't we allowing all data to be loaded on a single rank?
| Each entry of the list must contaion a 4D array on only one | ||
| MPI rank, and "None" on all other ranks. | ||
|
|
||
| mask: 3D array with nonzero values at active vertices |
|
|
||
| # Get/set ownership | ||
| ownership = self._get_ownership(subj) | ||
| full_pts = self._get_blocks(mask) if rank == 0 else None |
|
|
||
| """ | ||
|
|
||
| comm = MPI.COMM_WORLD |
There was a problem hiding this comment.
How about making comm an instance attribute?
|
|
||
| Parameters | ||
|
|
||
| subj: list of 4D arrays containing subset of subject data |
|
|
||
| Parameters | ||
|
|
||
| subj: list of 4D arrays containing subset of subject data |
There was a problem hiding this comment.
The padding should be documented here.
|
|
||
| return outmat | ||
|
|
||
| def searchlight_voxel(self, voxel_fn, pool_size=None): |
There was a problem hiding this comment.
How about run_searchlight? And run_block_function for searchlight_block?
| submasks = self._split_volume(mask, all_blocks) | ||
|
|
||
| # Scatter points, data, and mask | ||
| self.pts = self._scatter_list(all_blocks, 0) |
There was a problem hiding this comment.
What is a point? See pt in the example as well.
| mat: a 3D or 4D volume | ||
|
|
||
| block: a tuple containing block information: | ||
| - a triple containing the top left point of the block and |
There was a problem hiding this comment.
Top left front or top left back? Also, wouldn't it be better to remove direction altogether and say "the voxel with the lowest coordinates"?
| Parameters | ||
| ---------- | ||
|
|
||
| subj: list of 4D arrays containing data for one or more subjects. |
…is clients on the same node in start_ray.py (#148)
No description provided.