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 CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by