mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-15 06:09:01 +03:00
Replace numpy floats in update and evaluate
This commit is contained in:
parent
5d0d2de955
commit
75d097155d
|
@ -1329,8 +1329,7 @@ class Language:
|
||||||
and sgd not in (None, False)
|
and sgd not in (None, False)
|
||||||
):
|
):
|
||||||
proc.finish_update(sgd)
|
proc.finish_update(sgd)
|
||||||
|
return _replace_numpy_floats(losses)
|
||||||
return losses
|
|
||||||
|
|
||||||
def rehearse(
|
def rehearse(
|
||||||
self,
|
self,
|
||||||
|
@ -1578,7 +1577,7 @@ class Language:
|
||||||
results = scorer.score(examples, per_component=per_component)
|
results = scorer.score(examples, per_component=per_component)
|
||||||
n_words = sum(len(eg.predicted) for eg in examples)
|
n_words = sum(len(eg.predicted) for eg in examples)
|
||||||
results["speed"] = n_words / (end_time - start_time)
|
results["speed"] = n_words / (end_time - start_time)
|
||||||
return results
|
return _replace_numpy_floats(results)
|
||||||
|
|
||||||
def create_optimizer(self):
|
def create_optimizer(self):
|
||||||
"""Create an optimizer, usually using the [training.optimizer] config."""
|
"""Create an optimizer, usually using the [training.optimizer] config."""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user