6_NG .ipynb 49.3 KB
Newer Older
Saman Nia's avatar
Final    
Saman Nia committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Author: Saman Paidar Nia"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All resources are listed at the bottom of the page."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Get important libraries for this class.\n",
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import warnings\n",
    "import math\n",
    "import sys\n",
    "import logging\n",
    "#-----------------------------------------------------------\n",
    "from tensorflow.python.ops import control_flow_ops\n",
    "from IPython.display import clear_output\n",
    "from scipy.spatial.distance import squareform, pdist\n",
    "from sklearn.preprocessing import normalize\n",
    "from numpy import linalg as LA\n",
    "from scipy.cluster.vq import kmeans, vq\n",
    "from sklearn.metrics import normalized_mutual_info_score\n",
    "from math import sqrt\n",
    "#------------------------------------------------------------\n",
    "from sklearn.datasets import fetch_20newsgroups\n",
    "from sklearn.decomposition import TruncatedSVD\n",
    "from sklearn.feature_extraction.text import TfidfVectorizer\n",
    "from sklearn.pipeline import make_pipeline\n",
    "from sklearn.preprocessing import Normalizer\n",
    "from optparse import OptionParser\n",
    "from tqdm import tqdm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def standardization(X):\n",
    "    return normalize(X, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def laplacian(A):\n",
    "    S = np.sum(A, 0)\n",
    "    D = np.diag(S)\n",
    "    D = LA.matrix_power(D, -1)\n",
    "    L = np.dot(D, A)\n",
    "    return L"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def normalization(V):\n",
    "    return (V - min(V)) / (max(V) - min(V))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Correlation_Similarity:\n",
    "    def get_matrix(self, Data):\n",
    "        X = standardization(Data)\n",
    "        X = pdist(X, 'correlation')\n",
    "        X = squareform(X)\n",
    "        L = laplacian(X)\n",
    "        Y = np.apply_along_axis(normalization, 1, L)\n",
    "        np.fill_diagonal(Y, 0.)\n",
    "        return Y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Cosine_Similarity:\n",
    "    def get_matrix(self, Data):\n",
    "        X = standardization(Data)\n",
    "        X = pdist(X, 'cosine')\n",
    "        X = squareform(X)\n",
    "        L = laplacian(X)\n",
    "        Y = np.apply_along_axis(normalization, 1, L)\n",
    "        np.fill_diagonal(Y, 0.)\n",
    "        return Y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Similarity_Dataset_Iterator():\n",
    "    def __init__(self, data, labels, similarity):\n",
    "        self.data = data\n",
    "        self.labels = labels\n",
    "        self.matrix = similarity.get_matrix(data)\n",
    "        self.data_size = self.matrix.shape[0]\n",
    "        self.current_index = 0\n",
    "    def next_batch(self, num):\n",
    "        data=self.matrix.transpose()\n",
    "        labels=self.labels\n",
    "        idx = np.arange(0 , len(data))\n",
    "        np.random.shuffle(idx)\n",
    "        idx = idx[:num]\n",
    "        data_shuffle = [data[ i] for i in idx]\n",
    "        labels_shuffle = [labels[ i] for i in idx]\n",
    "        return data_shuffle, labels_shuffle\n",
    "    def whole_dataset(self):\n",
    "        return (self.matrix.transpose(), self.labels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#  Using Scikit-Learn libraries to fetching the Newsgroups data set: http://scikit-learn.org\n",
    "def read_NewsGroup_data(similarity):\n",
    "    logging.basicConfig(level=logging.INFO,\n",
    "                        format='%(asctime)s %(levelname)s %(message)s')\n",
    "    op = OptionParser()\n",
    "    op.add_option(\"--lsa\", dest=\"n_components\", type=\"int\",\n",
    "                  help=\"Preprocess documents with latent semantic analysis.\")    \n",
    "    op.add_option(\"--no-idf\",action=\"store_false\", dest=\"use_idf\", default=True,\n",
    "                  help=\"Disable Inverse Document Frequency feature weighting.\")\n",
    "    op.add_option(\"--use-hashing\", action=\"store_true\", default=False,\n",
    "                  help=\"Use a hashing feature vectorizer\")\n",
    "    op.add_option(\"--n-features\", type=int, default=10000,\n",
    "                  help=\"Maximum number of features to extract from text.\")    \n",
    "    def is_interactive():\n",
    "        return not hasattr(sys.modules['__main__'], '__file__')\n",
    "    argv = [] if is_interactive() else sys.argv[1:]\n",
    "    (opts, args) = op.parse_args(argv)\n",
    "    if len(args) > 0:\n",
    "        op.error(\"this script takes no arguments.\")\n",
    "        sys.exit(1)    \n",
    "    categories_6NG = ['alt.atheism','comp.sys.mac.hardware','rec.motorcycles',\n",
    "                      'rec.sport.hockey','soc.religion.christian','talk.religion.misc']\n",
    "    # categories = categories_6NG\n",
    "    dataset = fetch_20newsgroups(subset='train', categories=categories_6NG,\n",
    "                                 shuffle=True, random_state=42)\n",
    "    labels = dataset.target[:1200]\n",
    "    true_k = np.unique(labels).shape[0]\n",
    "    vectorizer = TfidfVectorizer(max_df=0.5, max_features=opts.n_features,min_df=2,\n",
    "                                 stop_words='english',use_idf=opts.use_idf)\n",
    "    X = vectorizer.fit_transform(dataset.data[:1200])\n",
    "    if opts.n_components:\n",
    "        svd = TruncatedSVD(opts.n_components)\n",
    "        normalizer = Normalizer(copy=False)\n",
    "        lsa = make_pipeline(svd, normalizer)\n",
    "        X = lsa.fit_transform(X)\n",
    "        explained_variance = svd.explained_variance_ratio_.sum()\n",
    "    return Similarity_Dataset_Iterator(X.toarray(), labels, similarity)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Call Correlation_Similarity as similarity dataset.\n",
    "trainSet_correlation = read_NewsGroup_data(Correlation_Similarity())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Call Cosine_Similarity as similarity dataset.\n",
    "trainSet_cosine = read_NewsGroup_data(Cosine_Similarity())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_input = trainSet_correlation.data_size #--------- Number of input data.\n",
    "# Define the number of hidden layer. \n",
    "if n_input >= 1024:\n",
    "    Nn = int(2048)\n",
    "elif n_input >= 512:\n",
    "    Nn = int(1024)\n",
    "elif n_input >= 256:\n",
    "    Nn = int(512)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "n_hidden_1 = int(Nn/2) #-------------------- The autoencoder hidden layer 1.\n",
    "n_hidden_2 = int(n_hidden_1/2) #------------ The autoencoder hidden layer 2.\n",
    "n_hidden_3 = int(n_hidden_2/2) #------------ The autoencoder hidden layer 3.\n",
    "n_code = str(int(n_hidden_3/2)) #----------- The number of output dimension value."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Layer 1: ----------- 1200\n",
      "Layer 2: ----------- 1024\n",
      "Layer 3: ----------- 512\n",
      "Layer 4: ----------- 256\n",
      "Layer 5: ----------- 128\n"
     ]
    }
   ],
   "source": [
    "print('Layer 1: -----------', n_input)\n",
    "print('Layer 2: -----------', n_hidden_1)\n",
    "print('Layer 3: -----------', n_hidden_2)\n",
    "print('Layer 4: -----------', n_hidden_3)\n",
    "print('Layer 5: -----------', int(n_code))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "def k_means_(X, n_clusters):\n",
    "    kmeans_centroids,_ =  kmeans(X, n_clusters)\n",
    "    kmeans_, _ = vq(X, kmeans_centroids)\n",
    "    return kmeans_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "def encoder(x, n_code, mode_train):    \n",
    "    with tf.variable_scope(\"encoder\"):        \n",
    "        with tf.variable_scope(\"hidden-layer-1\"):\n",
    "            hidden_1 = layer(x, [n_input, n_hidden_1], [n_hidden_1], mode_train)\n",
    "        with tf.variable_scope(\"hidden-layer-2\"):\n",
    "            hidden_2 = layer(hidden_1, [n_hidden_1, n_hidden_2], [n_hidden_2], mode_train)\n",
    "        with tf.variable_scope(\"hidden-layer-3\"):\n",
    "            hidden_3 = layer(hidden_2, [n_hidden_2, n_hidden_3], [n_hidden_3], mode_train)        \n",
    "        with tf.variable_scope(\"embedded\"):\n",
    "            code = layer(hidden_3, [n_hidden_3, n_code], [n_code], mode_train)\n",
    "    return code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "def decoder(code, n_code, mode_train):\n",
    "    with tf.variable_scope(\"decoder\"):\n",
    "        with tf.variable_scope(\"hidden-layer-1\"):\n",
    "            hidden_1 = layer(code, [n_code, n_hidden_3], [n_hidden_3], mode_train)\n",
    "        with tf.variable_scope(\"hidden-layer-2\"):\n",
    "            hidden_2 = layer(hidden_1, [n_hidden_3, n_hidden_2], [n_hidden_2], mode_train)\n",
    "        with tf.variable_scope(\"hidden-layer-3\"):\n",
    "            hidden_3 = layer(hidden_2, [n_hidden_2, n_hidden_1], [n_hidden_1], mode_train)              \n",
    "        with tf.variable_scope(\"reconstructed\"):\n",
    "            output = layer(hidden_3, [n_hidden_1, n_input], [n_input], mode_train)\n",
    "    return output"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def batch_norm(x, n_out, mode_train):\n",
    "    beta_initialize = tf.constant_initializer(value=0.1, dtype=tf.float32)\n",
    "    gamma_initialize = tf.constant_initializer(value=0.1, dtype=tf.float32)\n",
    "    beta = tf.get_variable(\"beta\", [n_out], initializer=beta_initialize)\n",
    "    gamma = tf.get_variable(\"gamma\", [n_out], initializer=gamma_initialize)\n",
    "    batch_mean, batch_var = tf.nn.moments(x, [0], name='moments')\n",
    "    ema = tf.train.ExponentialMovingAverage(decay=0.9)\n",
    "    ema_apply_op = ema.apply([batch_mean, batch_var])\n",
    "    ema_mean, ema_var = ema.average(batch_mean), ema.average(batch_var)\n",
    "    def mean_var():\n",
    "        with tf.control_dependencies([ema_apply_op]):\n",
    "            return tf.identity(batch_mean), tf.identity(batch_var)\n",
    "    mean, var = control_flow_ops.cond(mode_train, mean_var, lambda: (ema_mean, ema_var))\n",
    "    reshaped_x = tf.reshape(x, [-1, 1, 1, n_out])\n",
    "    normed = tf.nn.batch_norm_with_global_normalization(reshaped_x, mean, var, beta, gamma, 1e-08, True)\n",
    "    return tf.reshape(normed, [-1, n_out])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "def layer(input, weight_shape, bias_shape, mode_train):\n",
    "    value_initialize = (1.0 / weight_shape[0] ** 0.5)\n",
    "    weight_initialize = tf.random_normal_initializer(stddev = value_initialize, seed = None)\n",
    "    bias_initialize = tf.constant_initializer(value=0.0, dtype=tf.float32)\n",
    "    w = tf.get_variable(\"w\", weight_shape, initializer=weight_initialize)\n",
    "    b = tf.get_variable(\"b\", bias_shape, initializer=bias_initialize)\n",
    "    return tf.nn.sigmoid(batch_norm((tf.matmul(input, w) + b), weight_shape[1], mode_train))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "def loss(reconstructed, x):\n",
    "    with tf.variable_scope(\"train\"):\n",
    "        train_loss = tf.reduce_mean(tf.reduce_sum(tf.square(tf.subtract(reconstructed, x)), 1))\n",
    "        return train_loss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "def training(cost, learning_rate, beta1, beta2, global_step):\n",
    "    optimizer = tf.train.AdamOptimizer(learning_rate, beta1, beta2, epsilon=1e-08, use_locking=False, name='Adam')\n",
    "    train_op = optimizer.minimize(cost, global_step=global_step)\n",
    "    return train_op"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Parameters\n",
    "n_layers = 5 #------------------------------ Number of Neural Networks Layers.\n",
    "beta1 = 0.9 #------------------------------- The decay rate 1.  \n",
    "beta2 = 0.999 #----------------------------- The decay rate 2.\n",
    "learning_rate = (beta1/n_input) #----------- The learning rate.\n",
    "n_batch = math.ceil(sqrt(sqrt(n_input))) #-- Number of selection data in per step.\n",
    "n_backpro = math.ceil(n_input/n_batch) #---- Number of Backpro in per epoch.\n",
    "n_clusters = 6 #---------------------------- Number of clusters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_cor, labels_cor = trainSet_correlation.whole_dataset() #-- Allocation of data and labels\n",
    "data_cos, labels_cos = trainSet_cosine.whole_dataset() #------- Allocation of data and labels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "results_cor=[] #--------------------------- A list to keep all NMI scores.\n",
    "loss_cost_cor=[] #------------------------- A list to keep all training evaluations.\n",
    "seeding_cor=[] #--------------------------- A list to keep all steps."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NMI score for AE is: 70.16 and new cost is: 114.52 in 1 step of seeding.\n",
      "NMI score for AE is: 72.45 and new cost is: 114.27 in 2 step of seeding.\n",
      "NMI score for AE is: 69.27 and new cost is: 113.97 in 3 step of seeding.\n",
      "NMI score for AE is: 69.23 and new cost is: 114.16 in 4 step of seeding.\n",
      "NMI score for AE is: 67.78 and new cost is: 114.15 in 5 step of seeding.\n",
      "NMI score for AE is: 69.47 and new cost is: 114.41 in 6 step of seeding.\n",
      "NMI score for AE is: 70.08 and new cost is: 114.74 in 7 step of seeding.\n",
      "NMI score for AE is: 69.80 and new cost is: 114.52 in 8 step of seeding.\n",
      "NMI score for AE is: 66.31 and new cost is: 114.56 in 9 step of seeding.\n",
      "NMI score for AE is: 67.84 and new cost is: 114.10 in 10 step of seeding.\n"
     ]
    }
   ],
   "source": [
    "for i in range(1, 11):\n",
    "    with tf.Graph().as_default():    \n",
    "        with tf.variable_scope(\"autoencoder_architecture\"):\n",
    "            x = tf.placeholder(\"float\", [None, n_input])   \n",
    "            mode_train = tf.placeholder(tf.bool)\n",
    "            code = encoder(x, int(n_code), mode_train)\n",
    "            reconstructed = decoder(code, int(n_code), mode_train)\n",
    "            cost = loss(reconstructed, x)\n",
    "            global_step = tf.Variable(0, name='global_step', trainable=False)\n",
    "            train_optimizer = training(cost, learning_rate, beta1, beta2, global_step)\n",
    "            sess = tf.Session()\n",
    "            init_op = tf.global_variables_initializer()\n",
    "            sess.run(init_op)\n",
    "            # Training cycle\n",
    "            epoch = 0\n",
    "            while epoch == 0 or epoch < n_layers:\n",
    "                # Fit training with backpropagation using batch data.\n",
    "                for j in range(n_backpro):\n",
    "                    miniData, _ = trainSet_correlation.next_batch(n_batch)\n",
    "                    _, new_cost = sess.run([train_optimizer,cost], feed_dict={x: miniData,\n",
    "                                                                              mode_train: True})       \n",
    "                #------------------------- End of the Optimization ------------------------------\n",
    "                epoch += 1\n",
    "    # Getting embedded codes and running K-Means on them.\n",
    "    ae_codes_cor = sess.run(code, feed_dict={x: data_cor, mode_train: False})        \n",
    "    idx_cor = k_means_(ae_codes_cor, n_clusters)\n",
    "    ae_nmi_cor = normalized_mutual_info_score(labels_cor, idx_cor)\n",
    "    ae_nmi_cor = ae_nmi_cor*100\n",
    "    results_cor.append(ae_nmi_cor)    \n",
    "    seeding_cor.append(i)\n",
    "    loss_cost_cor.append(new_cost)    \n",
    "    print(\"NMI score for AE is: {:0.2f} and new cost is: {:0.2f} in {:d} step of seeding.\"\n",
    "          .format(ae_nmi_cor, new_cost, i))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Average of NMI Score for >>> 10 <<< Random Factors in Autoencoder Correlation is >>> 69.24 <<<\n"
     ]
    }
   ],
   "source": [
    "print(\"The Average of NMI Score for >>> {:d} <<< Random Factors in Autoencoder Correlation is >>> {:0.2f} <<<\"\n",
    "      .format(len(seeding_cor), (np.mean(results_cor))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[70.157021454776228,\n",
       " 72.452934005393033,\n",
       " 69.265142017049612,\n",
       " 69.225032780095759,\n",
       " 67.782874304673285,\n",
       " 69.472655105224646,\n",
       " 70.084932704240003,\n",
       " 69.795658344288,\n",
       " 66.305311609021842,\n",
       " 67.838123897753164]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results_cor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "results_cos=[] #--------------------------- A list to keep all NMI scores.\n",
    "loss_cost_cos=[] #------------------------- A list to keep all training evaluations.\n",
    "seeding_cos=[] #--------------------------- A list to keep all steps."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NMI score for AE is: 67.31 and new cost is: 116.99 in 1 step of seeding.\n",
      "NMI score for AE is: 65.44 and new cost is: 117.05 in 2 step of seeding.\n",
      "NMI score for AE is: 63.29 and new cost is: 117.00 in 3 step of seeding.\n",
      "NMI score for AE is: 63.93 and new cost is: 117.77 in 4 step of seeding.\n",
      "NMI score for AE is: 67.12 and new cost is: 118.15 in 5 step of seeding.\n",
      "NMI score for AE is: 65.82 and new cost is: 117.17 in 6 step of seeding.\n",
      "NMI score for AE is: 67.50 and new cost is: 117.55 in 7 step of seeding.\n",
      "NMI score for AE is: 64.08 and new cost is: 116.91 in 8 step of seeding.\n",
      "NMI score for AE is: 65.77 and new cost is: 116.71 in 9 step of seeding.\n",
      "NMI score for AE is: 66.14 and new cost is: 117.19 in 10 step of seeding.\n"
     ]
    }
   ],
   "source": [
    "for i in range(1, 11):\n",
    "    with tf.Graph().as_default():    \n",
    "        with tf.variable_scope(\"autoencoder_architecture\"):\n",
    "            x = tf.placeholder(\"float\", [None, n_input])   \n",
    "            mode_train = tf.placeholder(tf.bool)\n",
    "            code = encoder(x, int(n_code), mode_train)\n",
    "            reconstructed = decoder(code, int(n_code), mode_train)\n",
    "            cost = loss(reconstructed, x)\n",
    "            global_step = tf.Variable(0, name='global_step', trainable=False)\n",
    "            train_optimizer = training(cost, learning_rate, beta1, beta2, global_step)\n",
    "            sess = tf.Session()\n",
    "            init_op = tf.global_variables_initializer()\n",
    "            sess.run(init_op)\n",
    "            # Training cycle\n",
    "            epoch = 0\n",
    "            while epoch == 0 or epoch < n_layers:\n",
    "                # Fit training with backpropagation using batch data.\n",
    "                for j in range(n_backpro):\n",
    "                    miniData, _ = trainSet_cosine.next_batch(n_batch)\n",
    "                    _, new_cost = sess.run([train_optimizer,cost], feed_dict={x: miniData,\n",
    "                                                                              mode_train: True})       \n",
    "                #------------------------- End of the Optimization ------------------------------\n",
    "                epoch += 1\n",
    "    # Getting embedded codes and running K-Means on them.\n",
    "    ae_codes_cos = sess.run(code, feed_dict={x: data_cos, mode_train: False})        \n",
    "    idx_cos = k_means_(ae_codes_cos, n_clusters)\n",
    "    ae_nmi_cos = normalized_mutual_info_score(labels_cos, idx_cos)\n",
    "    ae_nmi_cos = ae_nmi_cos*100\n",
    "    results_cos.append(ae_nmi_cos)    \n",
    "    seeding_cos.append(i)\n",
    "    loss_cost_cos.append(new_cost)    \n",
    "    print(\"NMI score for AE is: {:0.2f} and new cost is: {:0.2f} in {:d} step of seeding.\"\n",
    "          .format(ae_nmi_cos, new_cost, i))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Average of NMI Score for >>> 10 <<< Random Factors in Autoencoder Cosine is >>> 65.64 <<<\n"
     ]
    }
   ],
   "source": [
    "print(\"The Average of NMI Score for >>> {:d} <<< Random Factors in Autoencoder Cosine is >>> {:0.2f} <<<\"\n",
    "      .format(len(seeding_cos), (np.mean(results_cos))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[67.307351689574062,\n",
       " 65.44124498139179,\n",
       " 63.288826886163129,\n",
       " 63.929453598682827,\n",
       " 67.116027514482283,\n",
       " 65.815785282093145,\n",
       " 67.496489757104385,\n",
       " 64.075875463273618,\n",
       " 65.771043582238391,\n",
       " 66.142179085569737]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results_cos"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEWCAYAAABrDZDcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl8FdX5+PHPk4XsEIIQ9l0QsrBv\nYiUgoqiISxWUCrh8aXFB7K9WW61gq622trW0tpYuCoosooitX/26EVSKlkX2XXaBhCUsIQGyPL8/\nZnJzb5KbBMjNDdzn/XrdV+7MnDlz5tzceeacmTlXVBVjjDGhKyzYBTDGGBNcFgiMMSbEWSAwxpgQ\nZ4HAGGNCnAUCY4wJcRYIjDEmxFkgMH6JyFQReT3Y5biQichEEckSkVwRaRTs8hhTEQsEIcw9OJW8\nikUk32t6TIC2OVVEVET6BiL/ukREIoHfAcNUNV5VD5dZ3tati/fKzH9dRKa67zPcNG+XSdPNnZ/p\nNU9FpKOfsrQUkbdE5JCIHBORtSIyvkZ21FzwLBCEMPfgFK+q8cBuYITXvFk1vT0REeAu4Agwrqbz\nd7cREYh8z1EyEA2sryJdfxEZWMnyg8DlZVoU44AtZ1GW14A9QBugETAWyDqL9atUx+renAULBKYq\n9URkpoicEJH1ItK7ZIGINHfPMg+KyA4RmVRFXt8BmgMPA6NFpJ6bT5SIHBWRVK+8G7stlCbu9A0i\nsspN9x8RSfdKu1NEHhORNcBJEYkQkcdF5Bu33BtE5Gav9OEi8lv37HiHiDzonk1HuMsbiMg/RGS/\niHwrIs+ISHhFO+SW/UUR2ee+XnTndQI2u8mOisinldTLr4FnKll+BngHGF1SfuB24GyCdR/gVVU9\nqaqFqvq1qr7vtR9XuPV6VET2lLQW3LqY6X7Gu0TkSREJc5eNF5ElIvJ7ETkCTHXn3yMiG0UkR0T+\n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XDtY6bY0DlLFz/+p6n4R+QmwCOcM+39VtarhgJsAfxORKHf6v8Cf3DKMB2Z7\nLXtSVbe43VXT3O6gCJyW0nqcEUn/KSJ5OIGs2lR1mYi8C6zGCUTLgWMAIvIDN83LZ5OnufjY6KPG\nXOREJF5Vc0UkFvgMmFDyW9rGgLUIjAkF00WkKxANzLAgYMqyFoExxoQ4u1hsjDEhzgKBMcaEOAsE\nxhgT4iwQGGNMiLNAYIwxIe7/A6XpWy+J0eAxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2a31c2c0dd8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "warnings.filterwarnings('ignore')\n",
    "plt.ylim(20,80)\n",
    "plt.plot(seeding_cor, results_cor, label='Autoencoder Correlation Simialrity', color='m', marker='o')\n",
    "plt.plot(seeding_cos, results_cos, label='Autoencoder Cosine Simialrity', color='g', marker='s')\n",
    "plt.xlabel('Number of Seeding.')\n",
    "plt.ylabel('NMI')\n",
    "plt.grid()\n",
    "plt.title('The Average of NMI Scores')\n",
    "plt.legend(loc='best')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Autoencoder Clustering on Cosine: ------------ 65.64\n",
      "Autoencoder Clustering on Correlation: ------- 69.24\n"
     ]
    }
   ],
   "source": [
    "print(\"Autoencoder Clustering on Cosine: ------------ {:0.2f}\".format(np.mean(results_cos)))\n",
    "print(\"Autoencoder Clustering on Correlation: ------- {:0.2f}\".format(np.mean(results_cor)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "____________________________________________________________________________________________________________________________\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "____________________________________________________________________________________________________________________________"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Refrences:\n",
    "\n",
    "SciPy (the library) Jones E, Oliphant E, Peterson P, et al. SciPy: Open Source Scientific Tools for Python, 2001-, http://www.scipy.org/ [Online; accessed 2018-02-20]. Here’s an example of a BibTeX entry:\n",
    "\n",
    "@Misc{, author = {Eric Jones and Travis Oliphant and Pearu Peterson and others}, title = {{SciPy}: Open source scientific tools for {Python}}, year = {2001--}, url = \"http://www.scipy.org/\", note = {[Online; accessed\n",
    "\n",
    "NumPy & SciPy:\n",
    "\n",
    "Stéfan van der Walt, S. Chris Colbert and Gaël Varoquaux. The NumPy Array: A Structure for Efficient Numerical Computation, Computing in Science & Engineering, 13, 22-30 (2011), DOI:10.1109/MCSE.2011.37 (publisher link)\n",
    "\n",
    "IPython:\n",
    "\n",
    "Fernando Pérez and Brian E. Granger. IPython: A System for Interactive Scientific Computing, Computing in Science & Engineering, 9, 21-29 (2007), DOI:10.1109/MCSE.2007.53 (publisher link)\n",
    "\n",
    "Matplotlib:\n",
    "\n",
    "John D. Hunter. Matplotlib: A 2D Graphics Environment, Computing in Science & Engineering, 9, 90-95 (2007), DOI:10.1109/MCSE.2007.55 (publisher link)\n",
    "\n",
    "Scikit-learn:\n",
    "\n",
    "Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot, Édouard Duchesnay. Scikit-learn: Machine Learning in Python, Journal of Machine Learning Research, 12, 2825-2830 (2011) (publisher link)\n",
    "\n",
    "TensorFlow:\n",
    "\n",
    "@misc{tensorflow2015-whitepaper, title={ {TensorFlow}: Large-Scale Machine Learning on Heterogeneous Systems}, url={https://www.tensorflow.org/}, note={Software available from tensorflow.org},\n",
    "\n",
    "Jupyter Notebooks:\n",
    "\n",
    "@conference{Kluyver:2016aa, Author = {Thomas Kluyver and Benjamin Ragan-Kelley and Fernando P{\\'e}rez and Brian Granger and Matthias Bussonnier and Jonathan Frederic and Kyle Kelley and Jessica Hamrick and Jason Grout and Sylvain Corlay and Paul Ivanov and Dami{\\'a}n Avila and Safia Abdalla and Carol Willing}, Booktitle = {Positioning and Power in Academic Publishing: Players, Agents and Agendas}, Editor = {F. Loizides and B. Schmidt}, Organization = {IOS Press}, Pages = {87 - 90}, Title = {Jupyter Notebooks -- a publishing format for reproducible computational workflows}, Year = {2016}}"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Raw Cell Format",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}