Distributed srm #220
Distributed srm #220
Conversation
@@ -132,6 +144,8 @@ class SRM(BaseEstimator, TransformerMixin): | |||
rho2_ : array, shape=[subjects] | |||
The estimated noise variance :math:`\\rho_i^2` for each subject | |||
comm_ : mpi4py.MPI.Intracomm | |||
The MPI communicator containing the data |
mihaic
Apr 28, 2017
Contributor
comm
should be used instead of comm_
everywhere, because it is given as a parameter, not computed from data:
http://scikit-learn.org/stable/developers/contributing.html#instantiation
http://scikit-learn.org/stable/developers/contributing.html#estimated-attributes
comm
should be used instead of comm_
everywhere, because it is given as a parameter, not computed from data:
http://scikit-learn.org/stable/developers/contributing.html#instantiation
http://scikit-learn.org/stable/developers/contributing.html#estimated-attributes
for subject in range(subjects): | ||
mu.append(np.mean(data[subject], 1)) | ||
np.random.seed(subject) |
mihaic
Apr 28, 2017
Contributor
How does this interact with self.rand_seed
?
How does this interact with self.rand_seed
?
mihaic
Apr 28, 2017
Contributor
Not addressed.
Not addressed.
mjanderson09
May 1, 2017
Author
Contributor
I removed this random seed per subject code. Instead, each SRM class instantiation can set a random seed (as before). This means for multiple ranks, each rank can potentially set a different seed. I don't think we can guarantee exactly deterministic results for the distributed implementation due to differences in parallel scheduling per run.
I removed this random seed per subject code. Instead, each SRM class instantiation can set a random seed (as before). This means for multiple ranks, each rank can potentially set a different seed. I don't think we can guarantee exactly deterministic results for the distributed implementation due to differences in parallel scheduling per run.
@@ -191,3 +223,4 @@ def test_det_srm(): | |||
print("Test: different number of samples per subject") | |||
|
|||
|
|||
test_can_instantiate() |
mihaic
Apr 28, 2017
Contributor
Wrap this call in if __name__ == "__main__"
, please.
Wrap this call in if __name__ == "__main__"
, please.
Jenkins, retest this please. |
1 similar comment
Jenkins, retest this please. |
@mjanderson09 great job! Don't need to do it now. You can do it in a different PR. Thank you! |
@@ -62,6 +63,9 @@ def test_can_instantiate(): | |||
|
|||
# Check that runs with 2 subject | |||
s.fit(X) | |||
sr_v0_4 = np.load('sr_v0_4.npy') | |||
diff_v0_4 = np.linalg.norm(sr_v0_4 - s.s_) | |||
assert(diff_v0_4 < 1e-5) |
mihaic
May 8, 2017
Contributor
Shouldn't the results be element-wise equal, i.e., np.allclose(sr_v0_4, s.s_)
, maybe with an atol
value?
Shouldn't the results be element-wise equal, i.e., np.allclose(sr_v0_4, s.s_)
, maybe with an atol
value?
@@ -62,6 +63,9 @@ def test_can_instantiate(): | |||
|
|||
# Check that runs with 2 subject | |||
s.fit(X) | |||
sr_v0_4 = np.load('sr_v0_4.npy') |
mihaic
May 8, 2017
Contributor
Add this to imports:
from pathlib import Path
Then:
Path(__file__).parent / "sr_v0_4.npy"
Add this to imports:
from pathlib import Path
Then:
Path(__file__).parent / "sr_v0_4.npy"
@TuKo, what say you? |
@TuKo says NIPS, sorry... |
@@ -190,4 +194,4 @@ def test_det_srm(): | |||
model.fit(X) | |||
print("Test: different number of samples per subject") | |||
|
|||
|
|||
test_can_instantiate() |
mihaic
May 11, 2017
Contributor
Please guard this call with if __name__ == "__main__"
.
Please guard this call with if __name__ == "__main__"
.
|
For the record, here is the effect of the changes on the accuracy in the image prediction example:
|
#220) * Added test for retriving variables from an optimizer * Added comments to test * Addressed comments * Fixed travis bug * Added fix to circular controls * Added set for explored operations and duplicate prefix stripping * Removed embeded ipython * Removed prefix, use seperate graph for each network * Removed redundant imports * Addressed comments and added separate graph to initializer * fix typos * get rid of prefix in documentation
No description provided.