Example #1
0
 def calcNodeDriftVector(self):
     """ calculates the drift vector of a node.
     """
     self.weightEstimate = 1.0
     self.ratioW = self.weightEstimate/self.weight
     # compute statistics delta vector.
     # delta = (weight*localStatistics - weightEstimate*localEstimate -
     # (weight - weightEstimate)*globalEstimate) / weight
     self.cm.delta = VectorOps.multAndAdd(self.cm.localStatistics, \
                     self.weight, self.localEstimate)
     VectorOps.multAndAddTo(self.cm.delta, self.ratioW-self.weight,\
                             self.cm.globalV)
     # update drift vector
     VectorOps.cpy(self.cm.drift, self.cm.globalV)
     VectorOps.addTo(self.cm.drift, self.cm.delta)
     VectorOps.multAndAddTo(self.cm.drift, 1.0/self.weight, self.cm.slack)
Example #2
0
 def calcNodeDriftVector(self):
     """ calculates the drift vector of a node.
     """
     self.weightEstimate = 1.0
     self.ratioW = self.weightEstimate / self.weight
     # compute statistics delta vector.
     # delta = (weight*localStatistics - weightEstimate*localEstimate -
     # (weight - weightEstimate)*globalEstimate) / weight
     self.cm.delta = VectorOps.multAndAdd(self.cm.localStatistics, \
                     self.weight, self.localEstimate)
     VectorOps.multAndAddTo(self.cm.delta, self.ratioW-self.weight,\
                             self.cm.globalV)
     # update drift vector
     VectorOps.cpy(self.cm.drift, self.cm.globalV)
     VectorOps.addTo(self.cm.drift, self.cm.delta)
     VectorOps.multAndAddTo(self.cm.drift, 1.0 / self.weight, self.cm.slack)