6

I have a 4 Input and 3 Output Neural network trained by particle swarm optimization (PSO) with Mean square error (MSE) as the fitness function using the IRIS Database provided by MATLAB. The fitness function is evaluated 50 times. The experiment is to classify features. I have a few doubts

(1) Does the PSO iterations/generations = number of times the fitness function is evaluated?

(2) In many papersTraining Curve I have seen the training curve of MSE vs generations being plot. In the picture, the graph (a) on left side is a model similar to NN. It is a 4 input-0 hidden layer-3 output cognitive map. And graph (b) is a NN trained by the same PSO. The purpose of this paper was to show the effectiveness of the new model in (a) over NN.

But they mention that the experiment is conducted say Cycles = 100 times with Generations =300. In that case, the Training curve for (a) and (b) should have been MSE vs Cycles and not MSE vs PSO generations ? For ex, Cycle1 : PSO iteration 1-50 --> Result(Weights_1,Bias_1, MSE_1, Classification Rate_1). Cycle2: PSO iteration 1- 50 -->Result(Weights_2,Bias_2, MSE_2, Classification Rate_2) and so on for 100 Cycles. How come the X axis in (a),(b) is different and what do they mean?

(3) Lastly, for every independent run of the program (Running the m file several times independently, through the console) , I never get the same classification rate (CR) or the same set of weights. Concretely, when I first run the program I get W (Weights) values and CR =100%. When I again run the Matlab code program, I may get CR = 50% and another set of weights!! As shown below for an example,

%Run1 (PSO generaions 1-50) 
>>PSO_NN.m

Correlation =

     0

Classification rate = 25



FinalWeightsBias =

   -0.1156    0.2487    2.2868    0.4460    0.3013    2.5761

%Run2 (PSO generaions 1-50) 
>>PSO_NN.m
Correlation =

     1

Classification rate = 100

%Run3 (PSO generaions 1-50) 
>>PSO_NN.m
Correlation =

   -0.1260

Classification rate = 37.5

    FinalWeightsBias =

   -0.1726    0.3468    0.6298   -0.0373    0.2954   -0.3254

What should be the correct method? So, which weight set should I finally take and how do I say that the network has been trained? I am aware that evolutionary algorithms due to their randomness will never give the same answer, but then how do I ensure that the network has been trained? Shall be obliged for clarification.

SKM
  • 959
  • 2
  • 19
  • 45
  • Are you going to give the bounty to the only guy who gave you any attention? ;) – buzjwa Apr 19 '14 at 09:50
  • 1
    SOrry, I did not understand what you mean by "Give bounty". I clicked on Accept answer symbol on the left. Is there something else that I missed? – SKM Apr 20 '14 at 14:18

1 Answers1

4
  1. As in most machine learning methods, the number of iterations in PSO is the number of times the solution is updated. In the case of PSO, this is the number of update rounds over all particles. The cost function here is evaluated after every particle is updated, so more than the number of iterations. Approximately, (# cost function calls) = (# iterations) * (# particles).
  2. The graphs here are comparing different classifiers, fuzzy cognitive maps for graph (a) and a neural network for graph (b). So the X-axis displays the relevant measures of learning iterations for each.
  3. Every time you run your NN you initialize it with different random values, so the results are never the same. The fact that the results vary greatly from one run to the next means you have a convergence problem. The first thing to do in this case is to try running more iterations. In general convergence is a rather complicated issue and the solutions vary greatly with applications (and read carefully through the answer and comments Isaac gave you on your other question). If your problem persists after increasing the number of iterations, you can post it as a new question, providing a sample of your data and the actual code you use to construct and train the network.
Community
  • 1
  • 1
buzjwa
  • 2,632
  • 2
  • 24
  • 37
  • Thank you for your reply. (1)BUt I am still unclear as to the plot of learning curve for PSO. The X axis = number of iterations in PSO?After each generation or iteration of PSO, fitness is plotted. Am I right?(3)If everytime we run NN with different random values, then which weights to we consider as the weights obtained from previous run will be lost. Same goes for FCM if I run the PSO for different initial values(i.e Run1 - PSO Iterations 1:300 gives WeightMatrix1. Run2 - PSO Iterations 1:300 gives another WeightMatrix2 and so on for 30 independent runs).Then,how do I check the performance? – SKM Apr 13 '14 at 15:30
  • Regarding convergence, when I run NN OR FCM I get negative correlation sometimes with classification rate = 0. Then when I again execute and run afresh, I get another result. So, results are fluctuating.Please help – SKM Apr 13 '14 at 15:32
  • 1) Yes. 3) This is exactly what I mean by convergence issue. Like I said, you should probably post your code and your data if you need assistance finding why your method is not converging. – buzjwa Apr 13 '14 at 17:02
  • Thank you for your reply. I will post the code after I myself carefully check it again. Should I let you know? – SKM Apr 13 '14 at 18:16
  • I'll see it and try to help. If you make it clear that this is a convergence issue for a neural network, I'm sure the real experts will show up :) – buzjwa Apr 13 '14 at 18:19
  • One final question (different from the main question posted). I am using IRIS database, how do I decide if the input set is linearly separable or not?How do I justify use of evolutionary algorithm in learning over the other gradient based tehniques? – SKM Apr 13 '14 at 18:24
  • If the data is linearly separable, you should be able to classify it correctly using any type of [linear classifier](http://en.wikipedia.org/wiki/Linear_classifier). If a linear classifier is unable to correctly separate the data, then you are justified in using a nonlinear method. – buzjwa Apr 14 '14 at 13:34
  • Thank you for your comments and help. Regarding my convergence issue, I have posted the question http://stackoverflow.com/questions/23064936/convergence-issue-of-neural-network-in-classification Shall be extremely grateful for your help. – SKM Apr 14 '14 at 16:10