code: def test_sequence_categorical_missing_negative(
      guesses, labels, names
  ):
      d_scores = SequenceCategoricalCrossentropy(
          normalize=False, names=names, neg_prefix="!", missing_value=""
      ).get_grad(guesses, labels)
      d_scores0 = d_scores[0]
  
      # [0.1, 0.5, 0.6] should be A
      assert d_scores0[0][0] == pytest.approx(-0.9, eps)
      assert d_scores0[0][1] == pytest.approx(0.5, eps)
      assert d_scores0[0][2] == pytest.approx(0.6, eps)
  
      # [0.4, 0.6, 0.3] should NOT be A
      assert d_scores0[1][0] == pytest.approx(0.4, eps)
      assert d_scores0[1][1] == pytest.approx(0.0, eps)
      assert d_scores0[1][2] == pytest.approx(0.0, eps)
  
      # [1, 1, 1] has missing gold label
      assert d_scores0[2][0] == pytest.approx(0.0, eps)
      assert d_scores0[2][1] == pytest.approx(0.0, eps)
      assert d_scores0[2][2] == pytest.approx(0.0, eps)
  
      # [0.0, 0.0, 0.0] should NOT be C
      assert d_scores0[3][0] == pytest.approx(0.0, eps)
      assert d_scores0[3][1] == pytest.approx(0.0, eps)
      assert d_scores0[3][2] == pytest.approx(0.0, eps)
  
file_path: thinc/thinc/tests/test_loss.py
imports: import numpy
  import pytest
  from thinc import registry
  from thinc.api import CategoricalCrossentropy, CosineDistance, L2Distance, SequenceCategoricalCrossentropy
label_desc: Use image node_id 8 for calling a global function with example usage: test_sequence_categorical_missing_negative(guesses, labels, names) without return types