code: def test_weight_decay(self):
      with self.strategy.scope():
          grads, var1, var2, var3 = (
              tf.zeros(()),
              backend.Variable(2.0),
              backend.Variable(3.0, name="exclude"),
              backend.Variable(4.0),
          )
          optimizer_1 = SGD(learning_rate=1.0, weight_decay=0.004)
          self.strategy.run(
              lambda: optimizer_1.apply_gradients(zip([grads], [var1]))
          )
  
          optimizer_2 = SGD(learning_rate=1.0, weight_decay=0.004)
  
          def opt2_run():
              optimizer_2.exclude_from_weight_decay(
                  var_names=["exclude"]
              )
              optimizer_2.apply_gradients(
                  zip([grads, grads], [var1, var2])
              )
  
          self.strategy.run(opt2_run)
  
          optimizer_3 = SGD(learning_rate=1.0, weight_decay=0.004)
  
          def opt3_run():
              optimizer_3.exclude_from_weight_decay(var_list=[var3])
              optimizer_3.apply_gradients(
                  zip([grads, grads], [var1, var3])
              )
  
          self.strategy.run(opt3_run)
  
      self.assertAlmostEqual(var1.numpy(), 1.9760959)
      self.assertAlmostEqual(var2.numpy(), 3.0)
      self.assertAlmostEqual(var3.numpy(), 4.0)
  
file_path: keras/keras/backend/tensorflow/optimizer_distribute_test.py
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow.python.eager import context
  from keras import backend
  from keras import testing
  from keras.optimizers.sgd import SGD
label_desc: Use image node_id 4 for calling the OptimizerDistributeTest obj's underlying member method code with example usage: obj.test_weight_decay() without return types