Cross entropy error computation

조회 수: 1 (최근 30일)
Eman Hassan
Eman Hassan 2020년 12월 23일
답변: Hiro Yoshino 2020년 12월 23일
Hi There,
I trained a model (classifier) to recognize the hand written digits from (0-9). The model is not related to any CNN types of Networks.
I tested the model prformance using accuracy, precsion and Recall. I am looking to do some error measurments analysis using cross entropy error.
my question is: given the actual label output, the predicted output of the model, how to find the cross entropy:
Example:
the target = [9 5 6 7 8 5 0 1]
the model output (predicted) = [ 5 5 9 7 8 5 0 1]
i want to use this information (only the target and the model output) to find the loss in the model.
i tried the dlarray given in the example: https://www.mathworks.com/help/deeplearning/ref/dlarray.crossentropy.html , but i dont think I am doing that in the right way, any suggestions!

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2020년 12월 23일
I believe that can be easier:
the function "classify" returns the label together with the probabilities for all the categories.
you can uses the probablities to work out the cross entropy.
In the case that function does not meet your request -
use activations function so you can see the output of hidden layers.
you can use the probability of the output

카테고리

Help CenterFile Exchange에서 Custom Training Loops에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by