import tensorflow as tf

        ranking_model_gradients = tf.gradients(self.rank_loss, ranking_model_params)
        if self.hparams.max_gradient_norm > 0:
            denoise_gradients, denoise_norm = tf.clip_by_global_norm(denoise_gradients,
                                                                     self.hparams.max_gradient_norm)
            ranking_model_gradients, ranking_model_norm = tf.clip_by_global_norm(ranking_model_gradients,
                                                                     self.hparams.max_gradient_norm * self.hparams.ranker_loss_weight)
        self.norm = tf.global_norm(denoise_gradients + ranking_model_gradients)

        opt_denoise = self.optimizer_func(self.hparams.learning_rate)
        opt_ranker = self.optimizer_func(self.ranker_learning_rate)

        denoise_updates = opt_denoise.apply_gradients(zip(denoise_gradients, denoise_params),
