コード例 #1
0
 def get_error(self, target, output):
     return N.mean(N.abs(target - output))
コード例 #2
0
 def get_error(self, target, output):
     diff = N.abs(
         (target - output) / N.clip(N.abs(target), N._epsilon, numpy.inf))
     return 100. * N.mean(diff)
コード例 #3
0
 def regularise(self, param):
     lOne = N.sum(N.abs(param)) * self.l1
     lTwo = N.sum(N.square(param)) * self.l2
     return lOne + lTwo