      def nr_feat(self):
          return self.extracter.nr_templ
  
      def end_training(self, *args, **kwargs):
          pass
  
      def dump(self, *args, **kwargs):
          pass
 
</s> remove         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)
 </s> add         pass </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  </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,
        # 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
      def nr_feat(self):
          return self.extracter.nr_templ
  
      def end_training(self, *args, **kwargs):
        # 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
  
      def dump(self, *args, **kwargs):
          pass
keep keep keep keep replace keep keep keep
 Play with hash kernel class 
spacy/_ml.pyx