I want to learn how to do classification using Neural Network in Matlab Having Elliptical Basis Function , Can any one help .... Code is attached
What I know is that first I need to create NN and then make Decision Making
Function ( Elliptical Basis Function )
tic
maxround = 5;
hiddenLayerSize = [3 5 7 10 13];
errors = zeros(maxround,1);
trainPerformance = zeros(maxround,1);
valPerformance = zeros(maxround,1);
testPerformance = zeros(maxround,1);
timedata = zeros(maxround,1);
NoofNeurons = zeros(maxround,1);
Accuracy = zeros(maxround,1);
TestFold = zeros(maxround,1);
NoOfClasses = zeros(maxround,1);
NoofInstances = zeros(maxround,1);
SizeofInputLayer = zeros(maxround,1);
for i=1: maxround
net = patternnet(hiddenLayerSize);
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
NoOfinputs = net.inputs
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
NoOfOutPuts = net.outputs
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainFcn = 'trainlm'; % Levenberg-Marquardt
net.performFcn = 'mse'; % Mean squared error
[net,tr] = train(net,inputs,targets);
outputs = net(inputs);
errors = gsubtract(targets,outputs);
performance(i) = perform(net,targets,outputs);
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
trainPerformance(i) = perform(net,trainTargets,outputs);
valPerformance(i) = perform(net,valTargets,outputs);
testPerformance(i) = perform(net,testTargets,outputs);
NoofNeurons(i) = hiddenLayerSize(1);
NameofDataSet = 'Heart';
TestFold(i) = i;
NoOfClasses(i) = size(targets,1); % Number of classed to be classified
NoofInstances(i) = size(targets,2); % Number of Instances
SizeofInputLayer(i) = size(inputs,2);
end

1 件のコメント

Walter Roberson
Walter Roberson 2012 年 1 月 2 日
Thank you for taking the time to format your code!

サインインしてコメントする。

 採用された回答

Greg Heath
Greg Heath 2012 年 1 月 4 日

1 投票

2 件のコメント

Greg Heath
Greg Heath 2012 年 1 月 8 日
編集済み: Greg Heath 2014 年 11 月 22 日
IGNORE THIS COMMENT OF 8 JAN 2012. IT IS BASED ON FAULTY LOGIC. FOR ANY OTHER VALUE OF THE LINEAR COMBINATION THAN ZERO, THE CONTOURS ARE ELLIPTIC. =========================================================================== WHOOPS! MY APOLOGIES!
I have just realized that , in general, NEWFF with RADBAS will not create EBFs. Consider a two-input net with w11*x1+w12*x2 + b1 the argument of RADBAS.
Obviously, exp(-(w11*x1+w12*x2+b1)^2) is equal to 1 along the line 0 =w11*x1+w12*x2+b1. Therefore the constant level contours are not ellipses.
Sorry for the bum steer.
Greg
Puneet Arora
Puneet Arora 2012 年 1 月 16 日
Then what do you suggest .. I need to change the H and O , My I-H-O is structure : 1 (inputs)-H- 4 (Outputs) and H = [1 2 4 8 16 32 64]
net = newff(minmax(ptrn),[H O],{'radbas', 'purelin'});
I m doing classification iris dataset ...

サインインしてコメントする。

その他の回答 (0 件)

タグ

質問済み:

2012 年 1 月 2 日

編集済み:

2014 年 11 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by