how to do comparison on neural network output

2 次查看(过去 30 天)
i have saved 8 outputs of neural netowrk in one matfile "db_net"...
is it possible.... for me to execute one image and check whether its neural network output matches with anyone in the db_net matfile.....
i did like this...
count = 0;
load db_net
for i = 1:8
if db_net{i} == net;
count = i;
break;
end
end
but i'm getting error as....
??? Undefined function or method 'eq' for input arguments of type 'network'.
Error in ==> MainFile at 140
if db_net{i} == net;
i think its because of equal to operator.... please can someone show me how to do comparison on neural network output.... please do reply.....
  2 个评论
Elysi Cochin
Elysi Cochin 2013-3-18
i observed that the neural network output changes each time it is executed.... is there any output of "net" that remains same every time..... so that i can use that value for comparison...
Greg Heath
Greg Heath 2013-3-18
Upon rereading your post I realized that I may not fully understand what you mean.
I thought you were saving trained nets obtained via training followed by the save command
db_net{ kk } = net ;
save db_net;
If so, the nets would be equal if and only if all properties have exactly the same values. Therefore, if the difference of just one component of one weight is not EXACTLY zero, the nets are different.
Is that really what you want?
Or are you saving net outputs y = net(x)? If so, the same comments apply.
Please clarify
Greg

请先登录,再进行评论。

采纳的回答

Greg Heath
Greg Heath 2013-3-18
>> net1 = fitnet;net2=fitnet;isequal(net1,net2)
ans =
1
Hope this helps.
Thank you for formally accepting my answer
Greg

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by