Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CNTK absolute error

Tags:

To find the loss during training a model we can use cntk.squared_error() function, like this:

loss = cntk.squared_error(z, l)

But I am interested in finding the loss in terms of absolute error. The below code doesn't work:

loss = cntk.absolute_error(z, l)

It gives error as:

AttributeError: module 'cntk' has no attribute 'absolute_error'

Is there any inbuilt function in CNTK toolkit to find the absolute error? I am new to deep learning so I don't know much. Thanks for help!

like image 905
Ank Avatar asked Oct 15 '17 08:10

Ank


1 Answers

There's no out-of-the-box L1 loss function in CNTK, but you can provide a custom one:

def absolute_error(z, l):
  return cntk.reduce_mean(cntk.abs(z - l))
like image 129
Maxim Avatar answered Sep 23 '22 14:09

Maxim