code: def xception_model(dropout):
      base_model = keras.applications.Xception(
          weights="imagenet",  # Load weights pre-trained on ImageNet.
          input_shape=(150, 150, 3),
          include_top=False,
      )  # Do not include the ImageNet classifier at the top.
  
      # Freeze the base_model
      base_model.trainable = False
      data_augmentation = keras.Sequential(
          [
              layers.RandomFlip("horizontal"),
              layers.RandomRotation(0.1),
          ]
      )
      # Create new model on top
      inputs = keras.Input(shape=(150, 150, 3))
      x = data_augmentation(inputs)  # Apply random data augmentation
  
      # Pre-trained Xception weights requires that input be scaled
      # from (0, 255) to a range of (-1., +1.), the rescaling layer
      # outputs: `(inputs * scale) + offset`
      scale_layer = keras.layers.Rescaling(scale=1 / 127.5, offset=-1)
      x = scale_layer(x)
  
      # The base model contains batchnorm layers. We want to keep them in inference mode
      # when we unfreeze the base model for fine-tuning, so we make sure that the
      # base_model is running in inference mode here.
      x = base_model(x, training=False)
      x = keras.layers.GlobalAveragePooling2D()(x)
      x = keras.layers.Dropout(dropout)(x)  # Regularize with dropout
      outputs = keras.layers.Dense(1)(x)
      model = keras.Model(inputs, outputs)
  
      model.compile(
          optimizer=keras.optimizers.Adam(),
          loss=keras.losses.BinaryCrossentropy(from_logits=True),
          metrics=[keras.metrics.BinaryAccuracy()],
      )
      return model
  
file_path: BigDL/python/orca/tutorial/tf/transfer_learning.py
imports: import math
  import tensorflow
  import tensorflow_datasets
  from tensorflow import keras
  from tensorflow.keras import layers
  from bigdl.orca import init_orca_context, stop_orca_context
  from bigdl.orca.learn.tf2 import Estimator
label_desc: Use image node_id 6 for calling a global function with example usage: xception_model(dropout) and returns: model