Skip to content

Distributed searchlight - #148

Merged
mihaic merged 11 commits into
brainiak:masterfrom
mjanderson09:distributed_searchlight
Nov 23, 2016
Merged

mihaic merged 11 commits into
brainiak:masterfrom
mjanderson09:distributed_searchlight

Conversation

@mjanderson09

Copy link
Copy Markdown
Contributor

No description provided.

@yidawang

Copy link
Copy Markdown
Member

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
"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document the way this code supposed is supposed to be executed.

Comment thread brainiak/searchlight/searchlight.py Outdated
self.max_blk_edge = max_blk_edge

def _get_ownership(self, data):
"""Determine which processes own each subject

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"process owns"?

Comment thread brainiak/searchlight/searchlight.py Outdated
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't time the last dimension?

Comment thread brainiak/searchlight/searchlight.py Outdated
----------

sl_rad: radius, in voxels, of the sphere inscribed in the
searchlight cube

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this include the center or not?

Comment thread brainiak/searchlight/searchlight.py Outdated

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we allowing all data to be loaded on a single rank?

Comment thread brainiak/searchlight/searchlight.py Outdated
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/nonzero/true

Comment thread brainiak/searchlight/searchlight.py Outdated

# Get/set ownership
ownership = self._get_ownership(subj)
full_pts = self._get_blocks(mask) if rank == 0 else None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a point?

Comment thread brainiak/searchlight/searchlight.py Outdated

"""

comm = MPI.COMM_WORLD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making comm an instance attribute?

Comment thread brainiak/searchlight/searchlight.py Outdated

Parameters

subj: list of 4D arrays containing subset of subject data

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/subj/subjs?

Comment thread brainiak/searchlight/searchlight.py Outdated

Parameters

subj: list of 4D arrays containing subset of subject data

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The padding should be documented here.

Comment thread brainiak/searchlight/searchlight.py Outdated

return outmat

def searchlight_voxel(self, voxel_fn, pool_size=None):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about run_searchlight? And run_block_function for searchlight_block?

Comment thread brainiak/searchlight/searchlight.py Outdated
submasks = self._split_volume(mask, all_blocks)

# Scatter points, data, and mask
self.pts = self._scatter_list(all_blocks, 0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a point? See pt in the example as well.

Comment thread brainiak/searchlight/searchlight.py Outdated
mat: a 3D or 4D volume

block: a tuple containing block information:
- a triple containing the top left point of the block and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"?

Comment thread brainiak/searchlight/searchlight.py Outdated
Parameters
----------

subj: list of 4D arrays containing data for one or more subjects.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about subjects?

@mihaic
mihaic merged commit 1895ec0 into brainiak:master Nov 23, 2016
@mjanderson09
mjanderson09 deleted the distributed_searchlight branch April 26, 2017 17:43
danielsuo pushed a commit that referenced this pull request Nov 16, 2017
danielsuo pushed a commit that referenced this pull request Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants