mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-06 21:03:07 +03:00
better copying for warmup docs
This commit is contained in:
parent
a2afc2c44c
commit
70b2d19423
|
@ -173,7 +173,5 @@ def print_outliers(sample: numpy.ndarray):
|
||||||
def warmup(
|
def warmup(
|
||||||
nlp: Language, docs: List[Doc], warmup_epochs: int, batch_size: Optional[int]
|
nlp: Language, docs: List[Doc], warmup_epochs: int, batch_size: Optional[int]
|
||||||
) -> numpy.ndarray:
|
) -> numpy.ndarray:
|
||||||
warmup_docs = []
|
docs = [doc.copy() for doc in docs * warmup_epochs]
|
||||||
for _ in range(warmup_epochs):
|
return annotate(nlp, docs, batch_size)
|
||||||
warmup_docs += [doc.from_docs([doc]) for doc in docs]
|
|
||||||
return annotate(nlp, warmup_docs, batch_size)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user