The function of penalty term

What’s the function of penalty term in loss function? What should the location loss, classification loss, object confidence loss set respectively?