import tensorflow as tf

			loss_summ = tf.summary.scalar("{0}_loss".format(str_summary_type), mean_cost)
			acc_summ = tf.summary.scalar("{0}_accuracy".format(str_summary_type), accuracy)
			merged = tf.summary.merge([loss_summ, acc_summ])
			return mean_cost, accuracy, y_pred, merged
		else:
			return mean_cost, accuracy, y_pred

	
	def training(self, cost):
		optimizer = tf.train.AdamOptimizer(learning_rate=self.learning_rate)
		# train_op = optimizer.minimize(cost)
		
		trainables = tf.trainable_variables()
		grads = tf.gradients(cost, trainables)
		grads, _ = tf.clip_by_global_norm(grads, clip_norm=self.clip_norm)
		capped_gvs = zip(grads, trainables)
		train_op = optimizer.apply_gradients(capped_gvs)
		return train_op
