code: def test_updatable_model_creation_ce_adam(self):
      builder = self.create_base_builder()
  
      builder.add_softmax(
          name="softmax",
          input_name="output",
          output_name="softmax_output",
      )
  
      builder.set_categorical_cross_entropy_loss(
          name="cross_entropy", input="softmax_output"
      )
  
      adam_params = AdamParams()
      adam_params.set_batch(value=10, allowed_set=[10, 20])
      builder.set_adam_optimizer(adam_params)
      builder.set_epochs(20)
  
      model_path = os.path.join(
          self.model_dir, "updatable_creation.mlmodel"
      )
      print(model_path)
      save_spec(builder.spec, model_path)
  
      mlmodel = MLModel(model_path)
      self.assertTrue(mlmodel is not None)
      spec = mlmodel.get_spec()
      self.assertTrue(spec.isUpdatable)
      self.assertTrue(spec.neuralNetwork.layers[0].isUpdatable)
      self.assertTrue(
          spec.neuralNetwork.layers[0].innerProduct.weights.isUpdatable
      )
      self.assertTrue(spec.neuralNetwork.layers[1].isUpdatable)
      self.assertTrue(
          spec.neuralNetwork.layers[1].innerProduct.weights.isUpdatable
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.lossLayers[
              0
          ].categoricalCrossEntropyLossLayer
          is not None
      )
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer
          is not None
      )
  
      self.assertTrue(
          _np.isclose(
              spec.neuralNetwork.updateParams.optimizer.adamOptimizer.learningRate.defaultValue,
              1e-2,
              atol=1e-4,
          )
      )
      self.assertTrue(
          _np.isclose(
              spec.neuralNetwork.updateParams.optimizer.adamOptimizer.miniBatchSize.defaultValue,
              10,
              atol=1e-4,
          )
      )
      self.assertTrue(
          _np.isclose(
              spec.neuralNetwork.updateParams.optimizer.adamOptimizer.beta1.defaultValue,
              0.9,
              atol=1e-4,
          )
      )
      self.assertTrue(
          _np.isclose(
              spec.neuralNetwork.updateParams.optimizer.adamOptimizer.beta2.defaultValue,
              0.999,
              atol=1e-4,
          )
      )
      self.assertTrue(
          _np.isclose(
              spec.neuralNetwork.updateParams.optimizer.adamOptimizer.eps.defaultValue,
              1e-8,
              atol=1e-8,
          )
      )
  
      self.assertTrue(
          _np.isclose(
              spec.neuralNetwork.updateParams.epochs.defaultValue,
              20,
              atol=1e-4,
          )
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.learningRate.range.minValue
          == 0
      )
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.learningRate.range.maxValue
          == 1
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.miniBatchSize.set.values
          == [10, 20]
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.beta1.range.minValue
          == 0
      )
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.beta1.range.maxValue
          == 1
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.beta2.range.minValue
          == 0
      )
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.beta2.range.maxValue
          == 1
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.eps.range.minValue
          == 0
      )
      self.assertTrue(
          spec.neuralNetwork.updateParams.optimizer.adamOptimizer.eps.range.maxValue
          == 1
      )
  
      self.assertTrue(
          spec.neuralNetwork.updateParams.epochs.set.values == [20]
      )
  
imports: import os, shutil
  import numpy
  import coremltools.models.datatypes
  import unittest
  import pytest
  import tempfile
  from coremltools.models.utils import save_spec
  from coremltools.models import MLModel
  from coremltools.models.neural_network import NeuralNetworkBuilder, AdamParams, SgdParams
  from coremltools.models.pipeline import PipelineRegressor, PipelineClassifier
label_desc: Use image node_id 5 for calling the MLModelUpdatableTest obj's underlying member method code with example usage: obj.test_updatable_model_creation_ce_adam() without return types