implementing weighted sum for compound objective