フィルターのクリア

Patternnet giving only 1 answer while testing

1 回表示 (過去 30 日間)
ANTONY XAVIER
ANTONY XAVIER 2020 年 2 月 4 日
回答済み: Chinmay Budhiraja 2020 年 6 月 18 日
I run this code to train network
net = patternnet(10);
net = train(net,P,T');
view(net)
y = net(P);
perf = perform(net,T,y);
classes = vec2ind(y);
and for testing:
out = sim(net,features)'
But im getting only a single answer

回答 (1 件)

Chinmay Budhiraja
Chinmay Budhiraja 2020 年 6 月 18 日
To my understanding, you have trained a network using patternnet but while testing the simulated response, you are getting only one answer.
Please check the size of features and see if it contains only 1 example. Also, while training, you have used T’, which is transpose of the matrix T, but while checking performance, you are comparing T and y. Usually, we pass the same matrix in both the places of size NumberOfClasses x NumberOfExamples. PFA sample code:
[x,t] = iris_dataset;
net = patternnet(10);
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,t,y);
classes = vec2ind(y);
out = sim(net, x);
You can check patternet for more details.

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by