* Add comment about zipf reweighting

This commit is contained in:
Matthew Honnibal 2015-05-27 01:14:07 +02:00
parent 4d37b66c55
commit 0eec1d12af
1 changed files with 3 additions and 0 deletions

View File

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