          self.nr_class = nr_class
          self.learn_rate = learn_rate
          self.mem = Pool()
          self.time = 0
          self.W = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
                                             sizeof(weight_t))
          self.mom = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
                                             sizeof(weight_t))
 
</s> remove         self.d_W = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
 </s> add         self.mom = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
                                           sizeof(weight_t))
        self.averages = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
                                           sizeof(weight_t))
        self.last_upd = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class, </s> remove         self._indices = new vector[uint64_t]()

    def __dealloc__(self):
        del self._indices
 </s> add  </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             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
        self.momentum = momentum
          self.nr_class = nr_class
          self.learn_rate = learn_rate
        self.momentum = momentum
          self.mem = Pool()
          self.time = 0
          self.W = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
                                             sizeof(weight_t))
          self.mom = <weight_t*>self.mem.alloc(self.nr_weight * self.nr_class,
                                             sizeof(weight_t))
keep add keep keep keep keep keep keep
 Play with hash kernel class 
spacy/_ml.pyx