code: def setUpClass(cls):
      cls.x = tf.placeholder(tf.float32, shape=[None, 784], name="x")
      cls.y_ = tf.placeholder(tf.int64, shape=[None], name="y_")
  
      # define the network
      cls.network = tl.layers.InputLayer(cls.x, name="input")
      cls.network = tl.layers.DropoutLayer(
          cls.network, keep=0.8, name="drop1"
      )
      cls.network = tl.layers.DenseLayer(
          cls.network, 800, tf.nn.relu, name="relu1"
      )
      cls.network = tl.layers.DropoutLayer(
          cls.network, keep=0.5, name="drop2"
      )
      cls.network = tl.layers.DenseLayer(
          cls.network, 800, tf.nn.relu, name="relu2"
      )
      cls.network = tl.layers.DropoutLayer(
          cls.network, keep=0.5, name="drop3"
      )
  
      cls.network = tl.layers.DenseLayer(
          cls.network, n_units=10, name="output"
      )
  
      # define cost function and metric.
      cls.y = cls.network.outputs
      cls.cost = tl.cost.cross_entropy(cls.y, cls.y_, name="cost")
  
      correct_prediction = tf.equal(tf.argmax(cls.y, 1), cls.y_)
  
      cls.acc = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
  
      # define the optimizer
      train_params = cls.network.all_params
      optimizer = tl.optimizers.AMSGrad(
          learning_rate=1e-4, beta1=0.9, beta2=0.999, epsilon=1e-8
      )
      cls.train_op = optimizer.minimize(cls.cost, var_list=train_params)
  
file_path: TensorLayer/tests/pending/test_optimizer_amsgrad.py
imports: import os
  import unittest
  import tensorflow
  import tensorlayer
  from tests.utils import CustomTestCase
label_desc: Use image node_id 1 for calling the Layer_Pooling_Test obj's underlying member method code with example usage: obj.setUpClass(cls) without return types