The code is too big to study, maybe share a minimal code block? however, why don’t you just print the parameters of the model before and after?
what do you mean by sum are you looping over all parameters and just adding them?