Solved by KFrank in post #5 
              
              
                Hi Sunil! 

If you want your kernels to be equal to the non-textual G_x and G_y you 
gave, why don’t you just set them to be equal, rather than try to “learn” 
them? 
In a related point, it is true that your G_x and G_y satisfy your desired 
constraint, and, indeed, loss_constrain takes on its minim…