예제 #1
0
def syn_master(batch_buffer, k, n_core, eta, alpha):
    new_eta = eta

    processes = []
    q = Queue()

    for i in xrange(n_core):
        d, eta, etaSum = batch_buffer[i]
        prc = Process(target=syn_worker, args=(d, eta, etaSum, alpha, q))
        processes.append(prc)
        prc.start()

    for i in xrange(n_core):
        delta_eta = q.get()
        _mea.add_eta(new_eta, delta_eta)

    for prc in processes:
        prc.join()

    return new_eta
예제 #2
0
def syn_master(batch_buffer,k,n_core,eta,alpha):
    new_eta = eta

    processes = []
    q = Queue()

    for i in xrange(n_core):
        d,eta,etaSum = batch_buffer[i]
        prc = Process(target = syn_worker, args = (d,eta,etaSum,alpha,q))
        processes.append(prc)
        prc.start()
        
    for i in xrange(n_core):
        delta_eta = q.get()
        _mea.add_eta(new_eta,delta_eta)
        
    for prc in processes:
        prc.join()
        
    return new_eta
예제 #3
0
 def add_eta(self, second):
     self.lock.acquire()
     _mea.add_eta(self.eta, second)
     self.lock.release()
예제 #4
0
파일: locked.py 프로젝트: shixing/SDA-LDA
 def add_eta(self,second):
     self.lock.acquire()
     _mea.add_eta(self.eta,second)
     self.lock.release()