                  else:
                      d_W[clas] += min(10., d_scores[clas])
  
      def finish_update(self, optimizer):
          cdef np.npy_intp[1] shape
          shape[0] = self.nr_weight * self.nr_class
          W_arr = np.PyArray_SimpleNewFromData(1, shape, np.NPY_FLOAT, self.W)
          dW_arr = np.PyArray_SimpleNewFromData(1, shape, np.NPY_FLOAT, self.d_W)
          optimizer(W_arr, dW_arr, key=1)
  
      @property
      def nr_active_feat(self):
          return self.nr_weight
  
 
</s> remove             d_W = &self.d_W[idx * nr_class]
            for clas in range(nr_class):
                if d_scores[clas] < 0:
                    d_W[clas] += max(-10., d_scores[clas])
                else:
                    d_W[clas] += min(10., d_scores[clas])
 </s> add             #avg = &self.averages[idx]
            #last_upd = &self.last_upd[idx]
            W = &self.W[idx]
            #mom = &self.mom[idx]
            for i in range(nr_class):
                if d_scores[i] == 0:
                    continue
                d = d_scores[i]
                W[i] -= self.learn_rate * d
                #unchanged = self.time - last_upd[i]
                #avg[i] += unchanged * W[i]
                #mom[i] *= self.momentum ** unchanged
                #mom[i] += self.learn_rate * d
                #W[i] -= mom[i]
                #last_upd[i] = self.time </s> remove         pass
 </s> add         # Average weights
        for i in range(self.nr_weight * self.nr_class):  
            unchanged = self.time - self.last_upd[i]
            self.averages[i] += self.W[i] * unchanged
            self.W[i], self.averages[i] = self.averages[i], self.W[i]
            self.W[i] /= self.time
            self.last_upd[i] = self.time </s> remove     def __init__(self, int nr_class, templates, weight_t learn_rate=0.001,
            size=2**18):
 </s> add     def __init__(self, int nr_class, templates,
            weight_t momentum=0.9, weight_t learn_rate=0.001, size=2**18): </s> remove         self._indices = new vector[uint64_t]()

    def __dealloc__(self):
        del self._indices
 </s> add 
        pass
                  else:
                      d_W[clas] += min(10., d_scores[clas])
  
      def finish_update(self, optimizer):
        pass
        pass
        pass
        pass
        pass
  
      @property
      def nr_active_feat(self):
          return self.nr_weight
  
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Play with hash kernel class 
spacy/_ml.pyx