mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
Fix fine_tune when optimizer is None
This commit is contained in:
parent
9c580ad28a
commit
1c5c256e58
|
@ -382,6 +382,7 @@ def fine_tune(embedding, combine=None):
|
||||||
model.d_mix[1] += flat_vecs.dot(flat_grad.T).sum()
|
model.d_mix[1] += flat_vecs.dot(flat_grad.T).sum()
|
||||||
|
|
||||||
bp_vecs([d_o * model.mix[1] for d_o in d_output], sgd=sgd)
|
bp_vecs([d_o * model.mix[1] for d_o in d_output], sgd=sgd)
|
||||||
|
if sgd is not None:
|
||||||
sgd(model._mem.weights, model._mem.gradient, key=model.id)
|
sgd(model._mem.weights, model._mem.gradient, key=model.id)
|
||||||
return [d_o * model.mix[0] for d_o in d_output]
|
return [d_o * model.mix[0] for d_o in d_output]
|
||||||
return output, fine_tune_bwd
|
return output, fine_tune_bwd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user