Further Printing the the value returned by the function, it surely seems to be going towards INF. But almost the same logic for custom regularization, works in tensorflow. Am I doing something wrong code wise.
Epoch: [0][0/391]       Time 6.739 (6.739)      Loss 3157501.5000 (3157501.5000)        Prec@1 10.938 (10.938)
Variable containing:
2.7529e+08
[torch.cuda.FloatTensor of size 1 (GPU 0)]
Variable containing:
4.1735e+12
[torch.cuda.FloatTensor of size 1 (GPU 0)]
Variable containing:
5.0968e+27
[torch.cuda.FloatTensor of size 1 (GPU 0)]
…
Then the error.
Thanks!