Skip to content
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

Ndv dont share mi clr but still lock per bootstrap #63

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions inferelator_ng/bbsr_tfa_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import os
import sys
from workflow import WorkflowBase
import design_response_translation #added python design_response
from tfa import TFA
Expand Down Expand Up @@ -41,14 +42,17 @@ def run(self):

for idx, bootstrap in enumerate(self.get_bootstraps()):
print('Bootstrap {} of {}'.format((idx + 1), self.num_bootstraps))

X = self.activity.ix[:, bootstrap]
Y = self.response.ix[:, bootstrap]
print('Calculating MI, Background MI, and CLR Matrix')
(self.clr_matrix, self.mi_matrix) = self.mi_clr_driver.run(X, Y)
# Force stdout to flush so that the output is readable from all workers
sys.stdout.flush()
if 0 == rank:
(self.clr_matrix, self.mi_matrix) = self.mi_clr_driver.run(X, Y)
kvs.put('mi %d'%idx, (self.clr_matrix, self.mi_matrix))
kvs.put('bootstrap %d'%idx, 'This is how we stop workers from moving ahead on a new bootstrap')
else:
(self.clr_matrix, self.mi_matrix) = kvs.view('mi %d'%idx)
kvs.view('bootstrap %d'%idx)
print('Calculating betas using BBSR')
ownCheck = utils.ownCheck(kvs, rank, chunk=25)
current_betas,current_rescaled_betas = self.regression_driver.run(X, Y, self.clr_matrix, self.priors_data,kvs,rank, ownCheck)
Expand Down