code: def test_gd_custom_target(self):
      def custom_loss(actual, predicted):
          actual_shape = tf.shape(actual)
          n_samples = actual_shape[0]
          actual = tf.reshape(actual, (n_samples, 1))
          return objectives.rmse(actual, predicted)
  
      optimizer = algorithms.GradientDescent(
          layers.Input(10) >> layers.Sigmoid(1),
          step=0.2,
          shuffle_data=True,
          batch_size=None,
          loss=custom_loss,
          target=tf.placeholder(tf.float32, shape=(None, 1, 1)),
      )
      x_train, _, y_train, _ = simple_classification()
  
      error_message = "Cannot feed value of shape \(60, 1\) for Tensor"
      with self.assertRaisesRegexp(ValueError, error_message):
          optimizer.train(x_train, y_train, epochs=1)
  
      optimizer.train(x_train, y_train.reshape(-1, 1, 1), epochs=1)
  
file_path: neupy/tests/algorithms/gd/test_gd.py
imports: import pickle
  import numpy
  import tensorflow
  from neupy import algorithms, layers
  from neupy.algorithms.gd import objectives
  from neupy.exceptions import InvalidConnection
  from base import BaseTestCase
  from helpers import simple_classification
label_desc: Use image node_id 9 for calling the GradientDescentTestCase obj's underlying member method code with example usage: obj.test_gd_custom_target() and returns: objectives