def combined_loss_given_predictions(log_probab_actions_new,
                                    log_probab_actions_old,
                                    value_prediction,
                                    padded_actions,
                                    padded_rewards,
                                    reward_mask,
                                    gamma=0.99,
                                    lambda_=0.95,
                                    epsilon=0.2,
                                    c1=1.0,
                                    c2=0.01):
  """Computes the combined (clipped loss + value loss) given predictions."""
  loss_value = value_loss_given_predictions(
      value_prediction, padded_rewards, reward_mask, gamma=gamma)
  loss_ppo = ppo_loss_given_predictions(log_probab_actions_new,
                                        log_probab_actions_old,
                                        value_prediction,
                                        padded_actions,
                                        padded_rewards,
                                        reward_mask,
                                        gamma=gamma,
                                        lambda_=lambda_,
                                        epsilon=epsilon)
  # TODO(afrozm): Add the entropy bonus, but since we don't do that in T2T
  # we'll skip if for now.
  entropy_bonus = 0.0
  return (loss_ppo + (c1 * loss_value) - (c2 * entropy_bonus), loss_ppo,
          loss_value, entropy_bonus)