code: def test_loss_decreases(tmpdir, local_backend):
      (
          input_features,
          output_features,
      ) = synthetic_test_data.get_feature_configs()
  
      config = {
          MODEL_TYPE: "gbm",
          "input_features": input_features,
          "output_features": output_features,
          # Disable feature filtering to avoid having no features due to small test dataset,
          # see https://stackoverflow.com/a/66405983/5222402
          TRAINER: {
              "num_boost_round": 2,
              "boosting_rounds_per_checkpoint": 1,
              "feature_pre_filter": False,
          },
      }
  
      generated_data = (
          synthetic_test_data.get_generated_data_for_optimizer()
      )
      model = LudwigModel(config, backend=local_backend)
      train_stats, _, _ = model.train(
          dataset=generated_data.train_df,
          output_directory=tmpdir,
          skip_save_processed_input=True,
          skip_save_progress=True,
          skip_save_unprocessed_output=True,
          skip_save_log=True,
      )
  
      # retrieve training losses for first and last entries.
      train_losses = train_stats["training"]["combined"]["loss"]
      last_entry = len(train_losses)
  
      # ensure train loss for last entry is less than or equal to the first entry.
      assert train_losses[last_entry - 1] <= train_losses[0]
  
imports: import os
  import numpy
  import pytest
  from ludwig.api import LudwigModel
  from ludwig.constants import INPUT_FEATURES, MODEL_TYPE, OUTPUT_FEATURES, TRAINER
  from ludwig.error import ConfigValidationError
  from ludwig.schema.model_types.base import ModelConfig
  from tests.integration_tests import synthetic_test_data
  from tests.integration_tests.utils import binary_feature
  from tests.integration_tests.utils import category_feature
  from tests.integration_tests.utils import generate_data, number_feature, text_feature
label_desc: Use image node_id 21 for calling a global function with example usage: test_loss_decreases(tmpdir, local_backend) without return types