class_docstr: Testing layers from tflearn/layers
class_docstr_tok: ["Testing","layers","from","tflearn\/layers"]
code: def test_conv_layers(self):
      X = [
          [0.0, 0.0, 0.0, 0.0],
          [1.0, 1.0, 1.0, 1.0],
          [0.0, 0.0, 1.0, 0.0],
          [1.0, 1.0, 1.0, 0.0],
      ]
      Y = [[1.0, 0.0], [0.0, 1.0], [1.0, 0.0], [0.0, 1.0]]
  
      with tf.Graph().as_default():
          g = tflearn.input_data(shape=[None, 4])
          g = tflearn.reshape(g, new_shape=[-1, 2, 2, 1])
          g = tflearn.conv_2d(g, 4, 2, activation="relu")
          g = tflearn.max_pool_2d(g, 2)
          g = tflearn.fully_connected(g, 2, activation="softmax")
          g = tflearn.regression(g, optimizer="sgd", learning_rate=1.0)
  
          m = tflearn.DNN(g)
          m.fit(X, Y, n_epoch=100, snapshot_epoch=False)
          # TODO: Fix test
          # self.assertGreater(m.predict([[1., 0., 0., 0.]])[0][0], 0.5)
  
      # Bulk Tests
      with tf.Graph().as_default():
          g = tflearn.input_data(shape=[None, 4])
          g = tflearn.reshape(g, new_shape=[-1, 2, 2, 1])
          g = tflearn.conv_2d(g, 4, 2)
          g = tflearn.conv_2d(g, 4, 1)
          g = tflearn.conv_2d_transpose(g, 4, 2, [2, 2])
          g = tflearn.max_pool_2d(g, 2)
  
file_path: tflearn/tests/test_layers.py
imports: import tensorflow.compat.v1
  import tflearn
  import unittest
  import os
label_desc: Use image node_id 2 for calling the TestLayers obj's underlying member method code with example usage: obj.test_conv_layers() without return types