How to add custom accuracy function in Matlab's inbuilt shallow neural network patternnet function for each iteration

조회 수: 1 (최근 30일)
I am using matlab's patternnet function to compare my custom neural net classifier.
After initializing the network as "net = patternnet(2,'trainscg')", we train the classifier using "[trainedNet,tr] = train(net,X,T,Xi,Ai,EW)" function where the 'tr' output function gives me training error, validation error and testing error. How can i add a custom function that calculates accuracy and saves the accuracy in the tr function similar to the error values that are stored for every iteration. Thanks in advance

답변 (1개)

Shashank Gupta
Shashank Gupta 2020년 12월 30일
Hi Chinmay,
I am afraid there is no straight forward way to do what you are intending to do. Although you can find out the accuracy after the training is completed. That should give you a way to compare your model with another network. Even if your sole purpose is to compare different classifier, you can do so using the loss too. The loss matrix provides the same feel.
Cheers.
  댓글 수: 1
Chinmay Rane
Chinmay Rane 2021년 1월 8일
Thank you for your reply. I wanted to check the accuracy for each iteration for LM algorithm. I understand that i can use the final accuracy to compare the model but i wanted to see if i can add a custom metric just as similar to custom loss metric i can add in the matlab network code. Anyways thanks i coded LM from scratch to compare. Thanks for your reply
Chinmay

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by