* Disable the Zipf-reweighting thing while investigate effect

This commit is contained in:
Matthew Honnibal 2015-05-31 06:48:43 +02:00
parent c037f80638
commit 6bba793df3
1 changed files with 6 additions and 4 deletions

View File

@ -47,13 +47,15 @@ cdef class Model:
@cython.cdivision @cython.cdivision
@cython.boundscheck(False) @cython.boundscheck(False)
cdef int regularize(self, Feature* feats, int n, int a=3) except -1: cdef int regularize(self, Feature* feats, int n, int a=3) except -1:
pass
# Disable this for now, while we investigate effect.
# Use the Zipfian corruptions technique from here: # Use the Zipfian corruptions technique from here:
# http://www.aclweb.org/anthology/N13-1077 # http://www.aclweb.org/anthology/N13-1077
# This seems good for 0.1 - 0.3 % on OOD data. # This seems good for 0.1 - 0.3 % on OOD data.
cdef int i #cdef int i
cdef long[:] zipfs = numpy.random.zipf(a, n) #cdef long[:] zipfs = numpy.random.zipf(a, n)
for i in range(n): #for i in range(n):
feats[i].value *= 1 / zipfs[i] # feats[i].value *= 1 / zipfs[i]
def end_training(self): def end_training(self):
self._model.end_training() self._model.end_training()