code: def prepare_dual_object(self):
      # Function to prepare dual object to be used for testing optimization.
      net_weights = [
          [[2, 2], [3, 3], [4, 4]],
          [[1, 1, 1], [-1, -1, -1]],
      ]
      net_biases = [
          np.transpose(np.matrix([0, 0, 0])),
          np.transpose(np.matrix([0, 0])),
      ]
      net_layer_types = ["ff_relu", "ff"]
      nn_params1 = nn.NeuralNetwork(
          net_weights, net_biases, net_layer_types
      )
  
      test_input = np.transpose(np.matrix([0, 0]))
      true_class = 0
      adv_class = 1
      input_minval = 0
      input_maxval = 0
      epsilon = 0.1
  
      # Creating dual variables to use for optimization
      lambda_pos = [
          tf.get_variable(
              "lambda_pos0",
              initializer=np.random.uniform(0, 0.1, size=(2, 1)).astype(
                  np.float32
              ),
          ),
          tf.get_variable(
              "lambda_pos1",
              initializer=np.random.uniform(0, 0.1, size=(3, 1)).astype(
                  np.float32
              ),
          ),
      ]
      lambda_neg = [
          tf.get_variable(
              "lambda_neg0",
              initializer=np.random.uniform(0, 0.1, size=(2, 1)).astype(
                  np.float32
              ),
          ),
          tf.get_variable(
              "lambda_neg1",
              initializer=np.random.uniform(0, 0.1, size=(3, 1)).astype(
                  np.float32
              ),
          ),
      ]
      lambda_quad = [
          tf.get_variable(
              "lambda_quad0",
              initializer=np.random.uniform(0, 0.1, size=(2, 1)).astype(
                  np.float32
              ),
          ),
          tf.get_variable(
              "lambda_quad1",
              initializer=np.random.uniform(0, 0.1, size=(3, 1)).astype(
                  np.float32
              ),
          ),
      ]
      lambda_lu = [
          tf.get_variable(
              "lambda_lu0",
              initializer=np.random.uniform(0, 0.1, size=(2, 1)).astype(
                  np.float32
              ),
          ),
          tf.get_variable(
              "lambda_lu1",
              initializer=np.random.uniform(0, 0.1, size=(3, 1)).astype(
                  np.float32
              ),
          ),
      ]
      nu = tf.reshape(
          tf.get_variable("nu", initializer=200.0, dtype=tf.float32),
          shape=(1, 1),
      )
      dual_var = {
          "lambda_pos": lambda_pos,
          "lambda_neg": lambda_neg,
          "lambda_quad": lambda_quad,
          "lambda_lu": lambda_lu,
          "nu": nu,
      }
      sess = tf.Session()
      dual_formulation_object = dual_formulation.DualFormulation(
          sess,
          dual_var,
          nn_params1,
          test_input,
          true_class,
          adv_class,
          input_minval,
          input_maxval,
          epsilon,
      )
      return sess, dual_formulation_object
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/experimental/certification/tests/optimization_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from cleverhans.experimental.certification import dual_formulation
  from cleverhans.experimental.certification import nn
  from cleverhans.experimental.certification import optimization
label_desc: Use image node_id 1 for calling the OptimizationTest obj's underlying member method code with example usage: obj.prepare_dual_object() and returns: sess,  dual_formulation_object