Search code examples
cntk

CNTK Loss and Error Metric function for multi label classification


Other than squared_error what other loss function / error function would I be able to use ?

I looked through https://cntk.ai/pythondocs/cntk.losses.html and wasn't able to find anything that helps.

i found documentation for brain script but not in python

any help would be amazing :)


Solution

  • The best source of documentation (IMHO) is python documentation. If you need to write your own loss function I found this post very helpful. Try using sigmoid function at the output layer and binary cross entropy loss or cosine loss.

    target = cntk.input_variable(input_dim)
    loss = cntk.binary_cross_entropy(z, target)
    

    This way your nodes will output probabilities independent of each other like [0.73, 0.02, 0.05, 0.26, 0.68].