class_docstr: Main class that defines training graph and defines training run method for the adding problem
docstr: Method that builds the graph for training
  Args:
      lr: float, learning rate
      max_gradient_norm: float, maximum gradient norm value for clipping
  
  Returns:
      None
code: def build_train_graph(self, lr, max_gradient_norm=None):
      """
      Method that builds the graph for training
      Args:
          lr: float, learning rate
          max_gradient_norm: float, maximum gradient norm value for clipping
  
      Returns:
          None
      """
      with tf.variable_scope("input", reuse=True):
          self.input_placeholder = tf.placeholder(
              tf.float32,
              [None, self.max_len, self.n_features_in],
              name="input",
          )
          self.label_placeholder = tf.placeholder(
              tf.float32, [None, 1], name="labels"
          )
  
      self.prediction = self.build_network_graph(
          self.input_placeholder, last_timepoint=True
      )
  
      with tf.variable_scope("training"):
          self.training_loss = tf.losses.mean_squared_error(
              self.label_placeholder, self.prediction
          )
  
          summary_ops_train = [
              tf.summary.scalar("Training Loss", self.training_loss)
          ]
          self.merged_summary_op_train = tf.summary.merge(
              summary_ops_train
          )
  
          summary_ops_val = [
              tf.summary.scalar("Validation Loss", self.training_loss)
          ]
          self.merged_summary_op_val = tf.summary.merge(summary_ops_val)
  
          # Calculate and clip gradients
          params = tf.trainable_variables()
          gradients = tf.gradients(self.training_loss, params)
          if max_gradient_norm is not None:
              clipped_gradients = [
                  t
                  if t is None
                  else tf.clip_by_norm(t, max_gradient_norm)
                  for t in gradients
              ]
          else:
              clipped_gradients = gradients
  
          # Optimization
          update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
          optimizer = tf.train.AdamOptimizer(lr)
          with tf.control_dependencies(update_ops):
              self.training_update_step = optimizer.apply_gradients(
                  zip(clipped_gradients, params)
              )
  
file_path: nlp-architect/examples/word_language_model_with_tcn/adding_problem/adding_model.py
imports: import os
  import tensorflow
  from nlp_architect.models.temporal_convolutional_network import TCN
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling the TCNForAdding obj's underlying member method code with example usage: obj.build_train_graph(lr, max_gradient_norm) without return types