This PyTorch implementation of the actor-critic algorithm calculates the losses like so:
actor_loss = -log_prob * discounted_reward
policy_loss = F.smooth_l1_loss(value, torch.tensor([discounted_reward]))
Both are different from the regular formulas which are, in the case of the actor loss (parameterized by $\theta$):
$$log[\pi_\theta(s_t,a_t)]Q_w(s_t,a_t)$$
and, in the case of the critic loss (parameterized by $w$):
$$r(s_t,a_t) + \gamma Q_w(s_{t+1},a_{t+1}) - Q_w(s_{t},a_{t}),$$
where $r(s_t,a_t)$ is the immediate reward following taking the action.
For the actor, "the immediate critic evaluation of the transition" was replaced with "the discounted reward". For the critic, the discounted evaluation of the value from the next state $r(s_t,a_t) + \gamma Q_w(s_{t+1},a_{t+1})$ was replaced by "the discounted reward". The $L_1$ loss is then calculated, effectively discarding the sign of the (equation) loss.
Questions:
Why did they make these changes?
Why is the sign discarded for the critic loss?