import tensorflow as tf

	
	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

