rahlk / Experimental-Algorithms

CSC 591: Experimental Algorithms
http://courses.ncsu.edu/csc591/lec/003/
MIT License
0 stars 0 forks source link

Convergence greater than 1 #8

Open rahlk opened 8 years ago

rahlk commented 8 years ago

@bigfatnoob I'm getting convergence > 1 (around 2.00). Seems weird, thoughts?

bigfatnoob commented 8 years ago

Convergence can be > 1. I guess the solutions are clearly not on the pareto front. Are you by any chance sending the random population into the final solution? Cause by the looks of it, I guess there are some random solutions.

rahlk commented 8 years ago

I think not. Here's what I have:

def GALE(n_proc=10,frontSize=100,iters=100):
  t = time()
  collect=[]
  final = []
  per = [iters/n_proc]*n_proc
  popSize = [frontSize/n_proc]*n_proc
  p=Pool(processes=n_proc)
  collect.extend(p.map(gale1, per))
  for cc in collect: final.extend(cc)
  ret = gale0(model=DTLZ2(n_dec=30, n_obj=3),new=final,pop=len(final))
  print('Time Taken: ', time()-t)
  # true = DTLZ2(n_dec=30, n_obj=3).get_pareto()
  m = measure(model=DTLZ2(n_dec=30, n_obj=3))
  conv = m.convergence(final)
  print("Convergence:",conv)
  # set_trace()
  return

And here's my convergence measurement snippet. Note I use euclidean distance, could this be the reason?

class measure:
  def __init__(self,model):
    self.mdl = model

  def convergence(self, obtained):
    """
    Calculate the convergence metric with respect to ideal
    solutions
    """
    gammas=[]
    ideals = self.mdl.get_pareto()
    def nearest(a,lst):
      # dist = euclidean(a, sorted(lst, key=lambda x:euclidean(x,a))[0])
      # set_trace()
      return euclidean(a, sorted(lst, key=lambda x:euclidean(x,a))[0])
    gammas = [nearest(self.mdl.solve(member),ideals) for member in obtained]
    return mean(gammas)
bigfatnoob commented 8 years ago

Your code looks right. I dont seem to understand why this is happening. Will look into it too

rahlk commented 8 years ago

@bigfatnoob Model POM3. Optimizer GALE.

These numbers for runtimes seem really wierd!

rank ,   Processors ,    med   ,   iqr 
----------------------------------------------------
   1 ,            8 ,    10.58  ,   1.23 (-*-            |              ),9.66000000, 10.21000000, 10.58000000, 10.94000000, 12.46000000
   1 ,            7 ,    11.33  ,   0.89 (- *            |              ),10.01000000, 10.58000000, 11.33000000, 11.42000000, 11.93000000
   1 ,           14 ,    11.32  ,   1.68 (- *-           |              ),9.79000000, 10.44000000, 11.32000000, 11.86000000, 13.21000000
   2 ,            9 ,    12.04  ,   1.51 ( - *--         |              ),10.54000000, 11.54000000, 12.04000000, 12.92000000, 14.75000000
   2 ,           13 ,    12.17  ,   1.29 (  -*-          |              ),11.53000000, 11.88000000, 12.17000000, 13.15000000, 13.63000000
   2 ,            6 ,    12.19  ,   1.76 (   *-          |              ),11.06000000, 11.48000000, 12.19000000, 12.76000000, 13.55000000
   3 ,           12 ,    13.93  ,    1.5 (     *-        |              ),12.63000000, 13.27000000, 13.93000000, 14.27000000, 15.33000000
   4 ,           10 ,    16.51  ,   1.67 (       -*-     |              ),15.34000000, 15.97000000, 16.51000000, 17.17000000, 18.48000000
   4 ,           11 ,    16.81  ,   1.49 (       -*-     |              ),15.74000000, 16.08000000, 16.81000000, 17.43000000, 17.87000000
   5 ,            3 ,    18.36  ,   2.63 (        --*  --|              ),16.53000000, 18.18000000, 18.36000000, 20.36000000, 21.92000000
   5 ,           15 ,    18.91  ,   1.53 (           *-  |              ),18.09000000, 18.38000000, 18.91000000, 19.79000000, 20.40000000
   5 ,            4 ,    19.53  ,   3.04 (        --  * -|              ),16.61000000, 18.38000000, 19.53000000, 21.15000000, 22.05000000
   6 ,            5 ,    22.56  ,   4.43 (         --    *--            ),16.94000000, 18.92000000, 22.56000000, 22.75000000, 24.70000000
   6 ,           16 ,    22.73  ,   1.17 (               *-             ),21.23000000, 21.78000000, 22.73000000, 22.91000000, 23.91000000
   7 ,            2 ,    31.19  ,   2.08 (               |     --- *--- ),27.77000000, 30.26000000, 31.19000000, 31.61000000, 34.000000
bigfatnoob commented 8 years ago

Yes they are wierd. Quick Inference

But it sure looks wierd. I'll run POM3 on island model tomorrow and see how that pans out

rahlk commented 8 years ago

DE on DTLZ2

rank ,         name ,    med   ,   iqr 
----------------------------------------------------
   1 ,           16 ,    0.0068  ,  0.0004 (*              |              ),0.00650000, 0.00670000, 0.00680000, 0.00700000, 0.00790000
   1 ,           14 ,    0.0188  ,  0.0011 (*              |              ),0.01650000, 0.01800000, 0.01880000, 0.01910000, 0.02070000
   1 ,           12 ,    0.021  ,  0.0009 (*              |              ),0.01960000, 0.02060000, 0.02100000, 0.02130000, 0.02530000
   1 ,           10 ,    0.0245  ,  0.0004 (*              |              ),0.02420000, 0.02440000, 0.02450000, 0.02480000, 0.02790000
   1 ,            8 ,     0.03  ,  0.0011 (*              |              ),0.02640000, 0.02960000, 0.03000000, 0.03020000, 0.04120000
   2 ,            6 ,    0.0498  ,  0.0064 ( *             |              ),0.04330000, 0.04380000, 0.04980000, 0.04990000, 0.05380000
   3 ,            4 ,    0.1726  ,  0.025 (   *           |              ),0.16760000, 0.16850000, 0.17260000, 0.19290000, 0.19630000
   4 ,            2 ,    1.1379  ,  0.1833 (               |          *-- ),1.08110000, 1.09600000, 1.13790000, 1.18660000, 1.28530000

DE on POM3

rank ,         name ,    med   ,   iqr 
----------------------------------------------------
   1 ,            8 ,    25.8526  ,  2.3762 (*              |              ),22.81, 25.09, 25.85, 27.47, 31.79
   2 ,           10 ,    35.2316  ,  6.3111 (  *            |              ),29.73, 31.40, 35.23, 37.35, 38.11
   3 ,           16 ,    38.0718  ,  3.9572 (  *            |              ),33.03, 34.95, 38.07, 38.45, 39.70
   4 ,            4 ,    51.6006  ,  6.4461 (   - *         |              ),42.34, 48.39, 51.60, 54.56, 59.09
   4 ,            6 ,    52.1208  ,  10.4865 (     *-        |              ),45.52, 48.15, 52.12, 57.47, 63.51
   4 ,           14 ,    54.7903  ,  8.8126 (     *-        |              ),51.23, 52.38, 54.79, 57.92, 63.15
   5 ,           12 ,    67.654  ,  6.3279 (        *      |              ),61.12, 63.26, 67.65, 68.64, 70.90
   6 ,            2 ,    162.9323  ,  30.8428 (               |   ---   *    ),127.66, 147.06, 162.93, 177.11, 180.39
rahlk commented 8 years ago

XOMO

DE:

rank ,         name ,    med   ,   iqr 
----------------------------------------------------
   1 ,           16 ,    1.4306  ,  0.0931 (*              |              ), 1.38,  1.39,  1.45,  1.49,  1.56
   2 ,           10 ,    1.6274  ,  0.0404 (*              |              ), 1.62,  1.63,  1.65,  1.71,  1.78
   3 ,           14 ,    2.3003  ,  0.0683 (*              |              ), 2.25,  2.28,  2.32,  2.37,  2.70
   3 ,           12 ,    2.5151  ,  0.0919 (*              |              ), 2.38,  2.45,  2.53,  2.54,  2.59
   4 ,            8 ,    4.8535  ,  0.2528 (  *            |              ), 4.72,  4.80,  4.86,  5.08,  5.40
   5 ,            6 ,    6.9459  ,  0.4597 (   -*          |              ), 6.48,  6.83,  6.99,  7.23,  7.65
   6 ,            4 ,    13.4684  ,  0.409 (        -*     |              ),13.05, 13.37, 13.47, 13.65, 13.89
   7 ,            2 ,    31.8618  , 1.1179 (               |      -*----- ),30.76, 31.68, 32.56, 33.60, 40.55
rahlk commented 8 years ago

DE on DTLZ (0.5sec per computation)

rank ,         name ,    med   ,   iqr 
----------------------------------------------------
   1 ,           16 ,    20.6292  ,  0.0046 (*              |              ),20.63, 20.63, 20.63, 20.63, 20.88
   2 ,           14 ,    73.4421  ,  0.0056 (        *      |              ),73.44, 73.44, 73.44, 73.45, 73.62
   3 ,           12 ,    85.4111  ,  0.0091 (          *    |              ),85.41, 85.41, 85.41, 85.42, 85.52
   4 ,           10 ,    97.5352  ,  0.0068 (            *  |              ),97.53, 97.53, 97.54, 97.54, 97.55
   5 ,            8 ,    121.642  ,  0.0064 (               |*             ),121.64, 121.64, 121.65, 121.65, 121.66
   6 ,            6 ,    200.061  ,  0.005  (               |             *),200.06, 200.06, 200.06, 200.07, 200.08