code: def test_three_classes_infer_categorical_crossentropy():
      dataset = np.array(["a", "a", "c", "b"])
      head = head_module.ClassificationHead(name="a", shape=(1,))
      adapter = head.get_adapter()
      dataset = adapter.adapt(dataset, batch_size=32)
      analyser = head.get_analyser()
      for data in dataset:
          analyser.update(data)
      analyser.finalize()
      head.config_from_analyser(analyser)
      head.build(
          keras_tuner.HyperParameters(),
          input_module.Input(shape=(32,)).build_node(
              keras_tuner.HyperParameters()
          ),
      )
      assert head.loss.name == "categorical_crossentropy"
  
file_path: autokeras/autokeras/blocks/heads_test.py
imports: import keras_tuner
  import numpy
  import tensorflow
  from tensorflow import keras
  from tensorflow import nest
  import autokeras
  from autokeras import hyper_preprocessors
  from autokeras import nodes
  from autokeras import preprocessors
  from autokeras import test_utils
  from autokeras.blocks import heads
label_desc: Use image node_id 2 for calling a global function with example usage: test_three_classes_infer_categorical_crossentropy() without return types