X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=test-dagnn.lua;h=5d8a309ce9769b547de0fa104b4b5f0b99157fe1;hb=7dc69291661dbdf731f0da2955e8fec5f288cbba;hp=9f343a981c67ae389acfee10b69df51de15c79f1;hpb=f1e78b9584e64728aed5482249380879dc7646a0;p=dagnn.git diff --git a/test-dagnn.lua b/test-dagnn.lua index 9f343a9..5d8a309 100755 --- a/test-dagnn.lua +++ b/test-dagnn.lua @@ -57,7 +57,7 @@ function checkGrad(model, criterion, input, target) local num = (loss1 - loss0) / (2 * epsilon) if num ~= ana then - err = math.max(err, torch.abs(num - ana) / torch.abs(num)) + err = math.max(err, math.abs(num - ana) / math.abs(num)) end end