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!
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))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With