code: def test_small_end_to_end(
      depth, width, vector_width, nb_epoch, create_model, ancora
  ):
      (train_X, train_Y), (dev_X, dev_Y) = ancora
      batch_size = 8
      model = create_model(depth, width, vector_width).initialize()
      optimizer = Adam(0.001)
      losses = []
      scores = []
      for _ in range(nb_epoch):
          losses.append(0.0)
          for X, Y in get_shuffled_batches(
              train_X, train_Y, batch_size
          ):
              Yh, backprop = model.begin_update(X)
              d_loss = []
              for i in range(len(Yh)):
                  d_loss.append(Yh[i] - Y[i])
                  losses[-1] += ((Yh[i] - Y[i]) ** 2).sum()
              backprop(d_loss)
              model.finish_update(optimizer)
          scores.append(
              evaluate_tagger(model, dev_X, dev_Y, batch_size)
          )
      assert losses[-1] < losses[0]
      assert scores[-1] > scores[0]
  
file_path: thinc/thinc/tests/layers/test_basic_tagger.py
imports: import random
  import pytest
  from thinc.api import Adam, HashEmbed, Model, Relu, Softmax, chain, expand_window, strings2arrays, with_array
label_desc: Use image node_id 6 for calling a global function with example usage: test_small_end_to_end(depth, width, vector_width, nb_epoch, create_model, ancora) without return types