class_docstr: Pipeline that learns span boundaries.
  
  DOCS: https://spacy.io/api/spanfinder
class_docstr_tok: ["Pipeline","that","learns","span","boundaries",".","DOCS",":","https",":","\/\/spacy.io\/api\/spanfinder"]
docstr: Find the loss and gradient of loss for the batch of documents and
  their predicted scores.
  examples (Iterable[Examples]): The batch of examples.
  scores: Scores representing the model's predictions.
  RETURNS (Tuple[float, Floats2d]): The loss and the gradient.
  
  DOCS: https://spacy.io/api/spanfinder#get_loss
docstr_tok: ["Find","the","loss","and","gradient","of","loss","for","the","batch","of","documents","and","their","predicted","scores",".","examples","(","Iterable","[","Examples","]",")",":","The","batch","of","examples",".","scores",":","Scores","representing","the","model","'s","predictions",".","RETURNS","(","Tuple","[","float",",","Floats2d","]",")",":","The","loss","and","the","gradient",".","DOCS",":","https",":","\/\/spacy.io\/api\/spanfinder","#","get_loss"]
code: def get_loss(self, examples, scores) -> Tuple[float, Floats2d]:
      """Find the loss and gradient of loss for the batch of documents and
      their predicted scores.
      examples (Iterable[Examples]): The batch of examples.
      scores: Scores representing the model's predictions.
      RETURNS (Tuple[float, Floats2d]): The loss and the gradient.
  
      DOCS: https://spacy.io/api/spanfinder#get_loss
      """
      truths, masks = self._get_aligned_truth_scores(
          examples, self.model.ops
      )
      d_scores = scores - self.model.ops.asarray2f(truths)
      d_scores *= masks
      loss = float((d_scores**2).sum())
      return loss, d_scores
  
imports: from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple
  from thinc.api import Config, Model, Optimizer, set_dropout_rate
  from thinc.types import Floats2d
  from ..errors import Errors
  from ..language import Language
  from ..scorer import Scorer
  from ..tokens import Doc, Span
  from ..training import Example
  from ..util import registry
  from .spancat import DEFAULT_SPANS_KEY
  from .trainable_pipe import TrainablePipe
label_desc: Use image node_id 5 for calling the SpanFinder obj's underlying member method code with example usage: obj.get_loss(examples, scores) and returns: loss,  d_scores