Solved by ptrblck in post #2 
              
              
                Interesting idea! 
I think you can try it, although I’m not sure, if your current similarity calculation is really useful. 
Your criterion would yield a low loss, if the weights are just scaled with a constant, but represent the same transformation. 
However, I’ve created a small example with some d…