Thank you for your answer.
I just provided 2 losses for simplicity, in my code I have more than 2 losses.
I think i got the gist of it 
Just one more thing, can I have alpha and beta to be trainable as well?