code: def test_fit_and_evaluate_tf(self):
      ray_ctx = OrcaRayContext.get()
      batch_size = 32
      global_batch_size = batch_size * ray_ctx.num_ray_nodes
  
      trainer = Estimator.from_keras(
          model_creator=model_creator,
          verbose=True,
          config=None,
          backend="ray",
          workers_per_node=2,
      )
  
      # model baseline performance
      start_stats = trainer.evaluate(
          create_test_dataset,
          batch_size=global_batch_size,
          num_steps=NUM_TEST_SAMPLES // global_batch_size,
      )
      print(start_stats)
  
      def scheduler(epoch):
          if epoch < 2:
              return 0.001
          else:
              return 0.001 * tf.math.exp(0.1 * (2 - epoch))
  
      scheduler = tf.keras.callbacks.LearningRateScheduler(
          scheduler, verbose=1
      )
      # train for 2 epochs
      trainer.fit(
          create_train_datasets,
          epochs=2,
          batch_size=global_batch_size,
          steps_per_epoch=10,
          callbacks=[scheduler],
      )
      trainer.fit(
          create_train_datasets,
          epochs=2,
          batch_size=global_batch_size,
          steps_per_epoch=10,
          callbacks=[scheduler],
      )
  
      # model performance after training (should improve)
      end_stats = trainer.evaluate(
          create_test_dataset,
          batch_size=global_batch_size,
          num_steps=NUM_TEST_SAMPLES // global_batch_size,
      )
      print(end_stats)
  
      # sanity check that training worked
      dloss = (
          end_stats["validation_loss"] - start_stats["validation_loss"]
      )
      dmse = (
          end_stats["validation_mean_squared_error"]
          - start_stats["validation_mean_squared_error"]
      )
      print(f"dLoss: {dloss}, dMSE: {dmse}")
  
      assert (
          dloss < 0 and dmse < 0
      ), "training sanity check failed. loss increased!"
  
imports: import math
  import os
  import shutil
  import tempfile
  import pytest
  from unittest import TestCase
  import tensorflow
  import numpy
  from bigdl.orca.data.pandas import read_csv
  from bigdl.orca.data import SparkXShards, XShards
  from bigdl.orca.data.tf.data import Dataset
  from bigdl.orca.learn.tf2 import Estimator
  from bigdl.orca.ray import OrcaRayContext
  from bigdl.orca import OrcaContext
label_desc: Use image node_id 2 for calling the TestTF2EstimatorRayBackend obj's underlying member method code with example usage: obj.test_fit_and_evaluate_tf() and returns: int, unknown