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

2 次查看(过去 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

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by