mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-21 22:10:34 +03:00
Fix depth=0, maxout pieces=0
This commit is contained in:
parent
511ced11ff
commit
31af39f851
|
@ -493,13 +493,16 @@ cdef class precompute_hiddens:
|
|||
if self.activation == "relu":
|
||||
mask = state_vector >= 0.
|
||||
state_vector *= mask
|
||||
else:
|
||||
mask = None
|
||||
|
||||
def backprop_nonlinearity(d_best, sgd=None):
|
||||
if isinstance(d_best, numpy.ndarray):
|
||||
ops = NumpyOps()
|
||||
else:
|
||||
ops = CupyOps()
|
||||
mask_ = ops.asarray(mask)
|
||||
if mask is not None:
|
||||
mask_ = ops.asarray(mask)
|
||||
|
||||
# This will usually be on GPU
|
||||
d_best = ops.asarray(d_best)
|
||||
|
|
Loading…
Reference in New Issue
Block a user