March 2019
Intermediate to advanced
208 pages
5h 32m
English
When we have the structure for the model, it is time to take a look at how to optimize it. For this, we need a loss function to minimize. There are quite a few loss functions to choose from.
The right loss function depends on what kind of problem you are solving. For example, in a classification model like ours, we need a loss function that can measure the difference between a predicted class and an actual class. It needs to do so for three classes. The categorical cross entropy function is a good candidate. In CNTK, this loss function is implemented as cross_entropy_with_softmax:
label = input_variable(3)loss = cross_entropy_with_softmax(z, label)
We need to import the cross_entropy_with_softmax function from the ...
Read now
Unlock full access