Train the scale of a whole layer's weights?

Hello everyone,

I have a practical problem and I don’t know how to realize that.

Assume that I have weights $w_1,w_2,…w_{10}$ for 10 different layers from some pre-trained network. Now I changed the loss function and I want to train parameters $c_1,c_2,…c_{10}$ so that I can minimize the new loss with weights $c_1w_1,c_2w_2,…c_{10}w_{10}$.

Please advise me if you could! Thank you very much!