This is the current batchnorm calculation:
y = \frac{x - mean[x]}{ \sqrt{Var[x] + \epsilon}} * gamma + beta
I want to formulate it as y=kx+b(as is shown in the picture below).
I am wandering how can I get the value of Var[x] and mean[x]??  Is using model.state_dict().values() function a good idea? But how can I use it while training a model? Do you have any examples to show me?
I know it’s a weird question, but if you have some suggestions, please let me know.
Thank you very much.