Have you solved this?
By the way, i find that some of the details in your code are different from the ones in the paper. In the paper, l0 are the initial costs for the two tasks respectively, but in your code, l0 is an averaged loss.