Reserve 0 for 'missing' in history features

This commit is contained in:
Matthew Honnibal 2017-10-06 06:10:13 -05:00
parent fbba7c517e
commit 5c750a9c2f
2 changed files with 3 additions and 1 deletions

View File

@ -231,6 +231,8 @@ class Embed(Model):
name = 'embed'
def __init__(self, nO, nV=None, **kwargs):
if nV is not None:
nV += 1
Model.__init__(self, **kwargs)
if 'name' in kwargs:
self.name = kwargs['name']

View File

@ -297,7 +297,7 @@ cdef cppclass StateC:
+ hash64(<void*>&this._hist, sizeof(RingBufferC), 1)
void push_hist(int act) nogil:
ring_push(&this._hist, act)
ring_push(&this._hist, act+1)
int get_hist(int i) nogil:
return ring_get(&this._hist, i)