Fix parser maxout_pieces=1

This commit is contained in:
Matthw Honnibal 2020-07-01 02:48:58 +02:00
parent 35af5819e0
commit fa6d473390
1 changed files with 2 additions and 2 deletions

View File

@ -465,6 +465,7 @@ cdef class precompute_hiddens:
return state_vector, backprop_maxout
def _relu_nonlinearity(self, state_vector):
state_vector = state_vector.reshape((state_vector.shape[0], -1))
mask = state_vector >= 0.
state_vector *= mask
# We're outputting to CPU, but we need this variable on GPU for the
@ -473,7 +474,6 @@ cdef class precompute_hiddens:
def backprop_relu(d_best):
d_best *= mask
d_best = d_best.reshape((d_best.shape + (1,)))
return d_best
return d_best.reshape((d_best.shape + (1,)))
return state_vector, backprop_relu