Training feedforward neural network

3 ビュー (過去 30 日間)
ASAD ULLAH
ASAD ULLAH 2016 年 4 月 13 日
回答済み: Greg Heath 2016 年 4 月 19 日
I have two gaussian distribution samples, one guassian contains 10,000 samples and the other gaussian also contains 10,000 samples, I would like to train a feed-forward neural network with these samples but I dont know how many samples I have to take in order to get an optimal decision boundary. Here is the code but I dont know exactly the solution and the output are weirds.
x1 = -49:1:50;
x2 = -49:1:50;
[X1, X2] = meshgrid(x1, x2);
Gaussian1 = mvnpdf([X1(:) X2(:)], mean1, var1);// for class A
Gaussian2 = mvnpdf([X1(:) X2(:)], mean2, var2);// for Class B
net = feedforwardnet(10);
G1 = reshape(Gaussian1, 10000,1);
G2 = reshape(Gaussian2, 10000,1);
input = [G1, G2];
output = [0, 1];
net = train(net, input, output);
When I ran the code it give me weird results. If the code is not correct, can someone please suggest me so that I can get a decision boundary for these two distributions.

回答 (1 件)

Greg Heath
Greg Heath 2016 年 4 月 19 日
For N I-dimensional input vectors from c classes, the corresponding N target vectors are {0,1} c-dimensional unit vectors:
[ I N ] = size(input)
[ c N ] = size(target)
where
target = ind2vec(trueclassindices)
and
trueclassindices = vec2ind(target)
Hope this helps.
Thank you for formally accepting my answer
Greg

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by