mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 17:24:41 +03:00
fix paste error
This commit is contained in:
parent
f1ed315249
commit
e67cf1a5a5
|
@ -527,4 +527,14 @@ cdef class precompute_hiddens:
|
|||
|
||||
return state_vector, backprop_relu
|
||||
|
||||
cdef inline int _arg_max(const float* scores, const int n_classes) nogil:
|
||||
cdef inline int _arg_max(const float* scores, const int n_classes) nogil:
|
||||
if n_classes == 2:
|
||||
return 0 if scores[0] > scores[1] else 1
|
||||
cdef int i
|
||||
cdef int best = 0
|
||||
cdef float mode = scores[0]
|
||||
for i in range(1, n_classes):
|
||||
if scores[i] > mode:
|
||||
mode = scores[i]
|
||||
best = i
|
||||
return best
|
||||
|
|
Loading…
Reference in New Issue
Block a user