Notebook to figure out how to separate MNIST examples of digits 0 - 4.


In [1]:
import tensorflow as tf
from tensorflow.contrib.layers import fully_connected
from tensorflow.examples.tutorials.mnist import input_data

In [2]:
mnist = input_data.read_data_sets("/tmp/data/")


Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.
Extracting /tmp/data/train-images-idx3-ubyte.gz
Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.
Extracting /tmp/data/train-labels-idx1-ubyte.gz
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.
Extracting /tmp/data/t10k-images-idx3-ubyte.gz
Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.
Extracting /tmp/data/t10k-labels-idx1-ubyte.gz

In [3]:
X_train, y_train = mnist.train.images, mnist.train.labels

In [4]:
X_train.shape


Out[4]:
(55000, 784)

In [5]:
y_train.shape


Out[5]:
(55000,)

In [26]:
pull = [idx for idx in range(len(y_train)) if y_train[idx] < 5]

In [27]:
pull


Out[27]:
[1,
 2,
 4,
 6,
 7,
 10,
 11,
 12,
 13,
 15,
 16,
 19,
 20,
 23,
 31,
 32,
 33,
 36,
 38,
 41,
 46,
 47,
 48,
 51,
 52,
 53,
 54,
 58,
 64,
 65,
 67,
 69,
 72,
 73,
 74,
 75,
 76,
 77,
 80,
 82,
 83,
 85,
 86,
 88,
 90,
 91,
 92,
 94,
 95,
 96,
 97,
 101,
 102,
 103,
 104,
 105,
 107,
 108,
 110,
 111,
 113,
 114,
 115,
 117,
 118,
 120,
 122,
 123,
 124,
 127,
 128,
 129,
 131,
 132,
 133,
 134,
 135,
 138,
 139,
 143,
 144,
 147,
 148,
 149,
 150,
 151,
 152,
 153,
 154,
 155,
 156,
 160,
 162,
 166,
 167,
 168,
 169,
 171,
 173,
 174,
 175,
 176,
 180,
 184,
 186,
 187,
 189,
 190,
 191,
 192,
 193,
 194,
 195,
 196,
 198,
 202,
 203,
 204,
 207,
 216,
 217,
 221,
 225,
 227,
 228,
 232,
 234,
 235,
 236,
 237,
 238,
 239,
 241,
 244,
 245,
 246,
 247,
 249,
 250,
 252,
 256,
 258,
 259,
 262,
 265,
 266,
 268,
 270,
 271,
 272,
 275,
 277,
 278,
 284,
 285,
 286,
 287,
 288,
 289,
 293,
 295,
 297,
 298,
 301,
 304,
 305,
 306,
 307,
 313,
 314,
 315,
 317,
 318,
 319,
 321,
 322,
 323,
 324,
 327,
 328,
 330,
 331,
 332,
 336,
 337,
 340,
 342,
 344,
 345,
 351,
 353,
 354,
 355,
 356,
 357,
 358,
 359,
 361,
 366,
 368,
 370,
 373,
 375,
 377,
 379,
 380,
 381,
 388,
 392,
 393,
 395,
 396,
 397,
 398,
 399,
 400,
 401,
 406,
 408,
 410,
 412,
 415,
 420,
 421,
 425,
 428,
 429,
 432,
 433,
 434,
 436,
 438,
 439,
 442,
 443,
 444,
 445,
 449,
 450,
 455,
 458,
 461,
 462,
 464,
 467,
 468,
 469,
 470,
 471,
 475,
 477,
 479,
 480,
 481,
 482,
 483,
 484,
 487,
 488,
 490,
 491,
 493,
 494,
 497,
 498,
 500,
 502,
 505,
 507,
 508,
 509,
 510,
 511,
 512,
 513,
 514,
 516,
 520,
 525,
 527,
 528,
 529,
 530,
 531,
 533,
 541,
 542,
 543,
 545,
 547,
 549,
 552,
 560,
 562,
 563,
 567,
 570,
 571,
 573,
 578,
 580,
 581,
 582,
 583,
 585,
 588,
 590,
 601,
 602,
 604,
 605,
 608,
 610,
 611,
 612,
 613,
 615,
 616,
 618,
 621,
 622,
 623,
 624,
 627,
 630,
 631,
 635,
 636,
 637,
 638,
 639,
 640,
 641,
 642,
 643,
 644,
 646,
 647,
 648,
 649,
 655,
 656,
 659,
 660,
 662,
 665,
 667,
 673,
 674,
 675,
 677,
 679,
 681,
 683,
 687,
 689,
 690,
 691,
 692,
 694,
 697,
 698,
 700,
 702,
 703,
 706,
 707,
 708,
 710,
 711,
 713,
 714,
 715,
 717,
 720,
 722,
 724,
 728,
 729,
 730,
 731,
 732,
 733,
 734,
 735,
 736,
 738,
 744,
 747,
 748,
 749,
 751,
 753,
 755,
 756,
 758,
 760,
 762,
 764,
 767,
 770,
 773,
 777,
 779,
 785,
 787,
 788,
 789,
 790,
 792,
 793,
 796,
 798,
 799,
 801,
 805,
 807,
 808,
 809,
 812,
 813,
 814,
 815,
 816,
 820,
 822,
 823,
 824,
 830,
 831,
 833,
 834,
 835,
 838,
 840,
 841,
 842,
 843,
 844,
 845,
 850,
 852,
 854,
 858,
 859,
 862,
 863,
 864,
 867,
 870,
 871,
 875,
 876,
 880,
 881,
 882,
 883,
 884,
 885,
 886,
 888,
 890,
 891,
 895,
 899,
 900,
 902,
 903,
 905,
 907,
 908,
 909,
 911,
 914,
 915,
 919,
 921,
 922,
 923,
 926,
 927,
 928,
 929,
 930,
 932,
 933,
 936,
 938,
 941,
 942,
 944,
 945,
 950,
 952,
 954,
 955,
 957,
 958,
 960,
 961,
 963,
 965,
 966,
 967,
 969,
 970,
 974,
 978,
 980,
 981,
 982,
 983,
 985,
 987,
 988,
 989,
 994,
 1001,
 1002,
 1003,
 1005,
 1007,
 1008,
 1009,
 1012,
 1016,
 1020,
 1021,
 1023,
 1025,
 1028,
 1032,
 1033,
 1034,
 1035,
 1037,
 1038,
 1039,
 1040,
 1043,
 1044,
 1045,
 1048,
 1049,
 1052,
 1055,
 1056,
 1057,
 1058,
 1059,
 1060,
 1062,
 1063,
 1065,
 1069,
 1070,
 1071,
 1075,
 1076,
 1079,
 1080,
 1081,
 1082,
 1083,
 1089,
 1094,
 1095,
 1097,
 1098,
 1099,
 1101,
 1103,
 1104,
 1105,
 1106,
 1107,
 1108,
 1110,
 1113,
 1114,
 1116,
 1117,
 1118,
 1120,
 1122,
 1123,
 1124,
 1125,
 1126,
 1127,
 1128,
 1133,
 1135,
 1137,
 1138,
 1142,
 1143,
 1144,
 1146,
 1148,
 1154,
 1160,
 1161,
 1165,
 1168,
 1170,
 1172,
 1175,
 1179,
 1181,
 1182,
 1183,
 1184,
 1185,
 1186,
 1189,
 1190,
 1192,
 1193,
 1197,
 1204,
 1206,
 1207,
 1208,
 1209,
 1210,
 1211,
 1212,
 1213,
 1215,
 1216,
 1218,
 1220,
 1222,
 1226,
 1227,
 1228,
 1229,
 1230,
 1231,
 1232,
 1233,
 1235,
 1244,
 1245,
 1247,
 1249,
 1251,
 1252,
 1253,
 1254,
 1256,
 1258,
 1260,
 1262,
 1268,
 1269,
 1270,
 1271,
 1273,
 1277,
 1279,
 1282,
 1283,
 1286,
 1289,
 1291,
 1292,
 1293,
 1296,
 1297,
 1298,
 1299,
 1302,
 1303,
 1307,
 1308,
 1309,
 1311,
 1312,
 1314,
 1316,
 1317,
 1318,
 1320,
 1323,
 1325,
 1326,
 1327,
 1328,
 1329,
 1330,
 1331,
 1332,
 1336,
 1337,
 1340,
 1341,
 1342,
 1344,
 1347,
 1348,
 1349,
 1350,
 1351,
 1356,
 1357,
 1360,
 1362,
 1365,
 1366,
 1367,
 1371,
 1372,
 1377,
 1380,
 1384,
 1386,
 1391,
 1394,
 1395,
 1398,
 1400,
 1405,
 1406,
 1408,
 1409,
 1410,
 1411,
 1413,
 1414,
 1415,
 1416,
 1419,
 1420,
 1421,
 1422,
 1423,
 1424,
 1425,
 1427,
 1428,
 1429,
 1430,
 1436,
 1440,
 1441,
 1442,
 1443,
 1444,
 1445,
 1446,
 1447,
 1448,
 1449,
 1450,
 1454,
 1458,
 1461,
 1462,
 1463,
 1465,
 1466,
 1467,
 1468,
 1469,
 1478,
 1480,
 1483,
 1484,
 1488,
 1489,
 1490,
 1492,
 1494,
 1496,
 1497,
 1499,
 1500,
 1502,
 1505,
 1511,
 1515,
 1516,
 1519,
 1521,
 1522,
 1530,
 1531,
 1532,
 1536,
 1537,
 1538,
 1539,
 1540,
 1543,
 1545,
 1546,
 1547,
 1549,
 1552,
 1554,
 1556,
 1558,
 1559,
 1560,
 1561,
 1565,
 1568,
 1570,
 1575,
 1576,
 1584,
 1585,
 1586,
 1591,
 1592,
 1593,
 1594,
 1595,
 1596,
 1598,
 1601,
 1603,
 1605,
 1607,
 1608,
 1609,
 1611,
 1612,
 1613,
 1614,
 1615,
 1617,
 1619,
 1621,
 1624,
 1626,
 1627,
 1628,
 1629,
 1630,
 1632,
 1633,
 1637,
 1639,
 1640,
 1642,
 1645,
 1647,
 1648,
 1649,
 1651,
 1652,
 1653,
 1654,
 1656,
 1658,
 1662,
 1663,
 1665,
 1667,
 1669,
 1672,
 1674,
 1676,
 1678,
 1681,
 1682,
 1683,
 1684,
 1685,
 1687,
 1689,
 1698,
 1700,
 1701,
 1702,
 1704,
 1706,
 1708,
 1709,
 1710,
 1711,
 1714,
 1716,
 1718,
 1719,
 1723,
 1724,
 1725,
 1729,
 1730,
 1733,
 1736,
 1737,
 1738,
 1739,
 1743,
 1745,
 1747,
 1748,
 1750,
 1753,
 1754,
 1755,
 1757,
 1758,
 1759,
 1761,
 1762,
 1763,
 1764,
 1766,
 1768,
 1771,
 1773,
 1775,
 1778,
 1780,
 1783,
 1784,
 1785,
 1791,
 1793,
 1794,
 1797,
 1798,
 1802,
 1804,
 1805,
 1809,
 1810,
 1811,
 1812,
 1815,
 1817,
 1819,
 1822,
 1823,
 1825,
 1826,
 1827,
 1832,
 1833,
 1834,
 1839,
 1841,
 1844,
 1846,
 1847,
 1851,
 1855,
 1856,
 1857,
 1858,
 1859,
 1860,
 1861,
 1863,
 1864,
 1865,
 1870,
 1875,
 1877,
 1879,
 1880,
 1883,
 1885,
 1887,
 1890,
 1892,
 1894,
 1898,
 1899,
 1900,
 1901,
 1904,
 1906,
 1910,
 1912,
 1913,
 1917,
 1919,
 1920,
 1921,
 1923,
 1925,
 1926,
 1928,
 1931,
 1933,
 1935,
 1937,
 1939,
 1941,
 1944,
 1945,
 1946,
 1948,
 ...]

In [6]:
enumerated_y = list(enumerate(y_train))

In [7]:
indices = [index for index, label in enumerated_y if label < 5]

In [8]:
indices


Out[8]:
[1,
 2,
 4,
 6,
 7,
 10,
 11,
 12,
 13,
 15,
 16,
 19,
 20,
 23,
 31,
 32,
 33,
 36,
 38,
 41,
 46,
 47,
 48,
 51,
 52,
 53,
 54,
 58,
 64,
 65,
 67,
 69,
 72,
 73,
 74,
 75,
 76,
 77,
 80,
 82,
 83,
 85,
 86,
 88,
 90,
 91,
 92,
 94,
 95,
 96,
 97,
 101,
 102,
 103,
 104,
 105,
 107,
 108,
 110,
 111,
 113,
 114,
 115,
 117,
 118,
 120,
 122,
 123,
 124,
 127,
 128,
 129,
 131,
 132,
 133,
 134,
 135,
 138,
 139,
 143,
 144,
 147,
 148,
 149,
 150,
 151,
 152,
 153,
 154,
 155,
 156,
 160,
 162,
 166,
 167,
 168,
 169,
 171,
 173,
 174,
 175,
 176,
 180,
 184,
 186,
 187,
 189,
 190,
 191,
 192,
 193,
 194,
 195,
 196,
 198,
 202,
 203,
 204,
 207,
 216,
 217,
 221,
 225,
 227,
 228,
 232,
 234,
 235,
 236,
 237,
 238,
 239,
 241,
 244,
 245,
 246,
 247,
 249,
 250,
 252,
 256,
 258,
 259,
 262,
 265,
 266,
 268,
 270,
 271,
 272,
 275,
 277,
 278,
 284,
 285,
 286,
 287,
 288,
 289,
 293,
 295,
 297,
 298,
 301,
 304,
 305,
 306,
 307,
 313,
 314,
 315,
 317,
 318,
 319,
 321,
 322,
 323,
 324,
 327,
 328,
 330,
 331,
 332,
 336,
 337,
 340,
 342,
 344,
 345,
 351,
 353,
 354,
 355,
 356,
 357,
 358,
 359,
 361,
 366,
 368,
 370,
 373,
 375,
 377,
 379,
 380,
 381,
 388,
 392,
 393,
 395,
 396,
 397,
 398,
 399,
 400,
 401,
 406,
 408,
 410,
 412,
 415,
 420,
 421,
 425,
 428,
 429,
 432,
 433,
 434,
 436,
 438,
 439,
 442,
 443,
 444,
 445,
 449,
 450,
 455,
 458,
 461,
 462,
 464,
 467,
 468,
 469,
 470,
 471,
 475,
 477,
 479,
 480,
 481,
 482,
 483,
 484,
 487,
 488,
 490,
 491,
 493,
 494,
 497,
 498,
 500,
 502,
 505,
 507,
 508,
 509,
 510,
 511,
 512,
 513,
 514,
 516,
 520,
 525,
 527,
 528,
 529,
 530,
 531,
 533,
 541,
 542,
 543,
 545,
 547,
 549,
 552,
 560,
 562,
 563,
 567,
 570,
 571,
 573,
 578,
 580,
 581,
 582,
 583,
 585,
 588,
 590,
 601,
 602,
 604,
 605,
 608,
 610,
 611,
 612,
 613,
 615,
 616,
 618,
 621,
 622,
 623,
 624,
 627,
 630,
 631,
 635,
 636,
 637,
 638,
 639,
 640,
 641,
 642,
 643,
 644,
 646,
 647,
 648,
 649,
 655,
 656,
 659,
 660,
 662,
 665,
 667,
 673,
 674,
 675,
 677,
 679,
 681,
 683,
 687,
 689,
 690,
 691,
 692,
 694,
 697,
 698,
 700,
 702,
 703,
 706,
 707,
 708,
 710,
 711,
 713,
 714,
 715,
 717,
 720,
 722,
 724,
 728,
 729,
 730,
 731,
 732,
 733,
 734,
 735,
 736,
 738,
 744,
 747,
 748,
 749,
 751,
 753,
 755,
 756,
 758,
 760,
 762,
 764,
 767,
 770,
 773,
 777,
 779,
 785,
 787,
 788,
 789,
 790,
 792,
 793,
 796,
 798,
 799,
 801,
 805,
 807,
 808,
 809,
 812,
 813,
 814,
 815,
 816,
 820,
 822,
 823,
 824,
 830,
 831,
 833,
 834,
 835,
 838,
 840,
 841,
 842,
 843,
 844,
 845,
 850,
 852,
 854,
 858,
 859,
 862,
 863,
 864,
 867,
 870,
 871,
 875,
 876,
 880,
 881,
 882,
 883,
 884,
 885,
 886,
 888,
 890,
 891,
 895,
 899,
 900,
 902,
 903,
 905,
 907,
 908,
 909,
 911,
 914,
 915,
 919,
 921,
 922,
 923,
 926,
 927,
 928,
 929,
 930,
 932,
 933,
 936,
 938,
 941,
 942,
 944,
 945,
 950,
 952,
 954,
 955,
 957,
 958,
 960,
 961,
 963,
 965,
 966,
 967,
 969,
 970,
 974,
 978,
 980,
 981,
 982,
 983,
 985,
 987,
 988,
 989,
 994,
 1001,
 1002,
 1003,
 1005,
 1007,
 1008,
 1009,
 1012,
 1016,
 1020,
 1021,
 1023,
 1025,
 1028,
 1032,
 1033,
 1034,
 1035,
 1037,
 1038,
 1039,
 1040,
 1043,
 1044,
 1045,
 1048,
 1049,
 1052,
 1055,
 1056,
 1057,
 1058,
 1059,
 1060,
 1062,
 1063,
 1065,
 1069,
 1070,
 1071,
 1075,
 1076,
 1079,
 1080,
 1081,
 1082,
 1083,
 1089,
 1094,
 1095,
 1097,
 1098,
 1099,
 1101,
 1103,
 1104,
 1105,
 1106,
 1107,
 1108,
 1110,
 1113,
 1114,
 1116,
 1117,
 1118,
 1120,
 1122,
 1123,
 1124,
 1125,
 1126,
 1127,
 1128,
 1133,
 1135,
 1137,
 1138,
 1142,
 1143,
 1144,
 1146,
 1148,
 1154,
 1160,
 1161,
 1165,
 1168,
 1170,
 1172,
 1175,
 1179,
 1181,
 1182,
 1183,
 1184,
 1185,
 1186,
 1189,
 1190,
 1192,
 1193,
 1197,
 1204,
 1206,
 1207,
 1208,
 1209,
 1210,
 1211,
 1212,
 1213,
 1215,
 1216,
 1218,
 1220,
 1222,
 1226,
 1227,
 1228,
 1229,
 1230,
 1231,
 1232,
 1233,
 1235,
 1244,
 1245,
 1247,
 1249,
 1251,
 1252,
 1253,
 1254,
 1256,
 1258,
 1260,
 1262,
 1268,
 1269,
 1270,
 1271,
 1273,
 1277,
 1279,
 1282,
 1283,
 1286,
 1289,
 1291,
 1292,
 1293,
 1296,
 1297,
 1298,
 1299,
 1302,
 1303,
 1307,
 1308,
 1309,
 1311,
 1312,
 1314,
 1316,
 1317,
 1318,
 1320,
 1323,
 1325,
 1326,
 1327,
 1328,
 1329,
 1330,
 1331,
 1332,
 1336,
 1337,
 1340,
 1341,
 1342,
 1344,
 1347,
 1348,
 1349,
 1350,
 1351,
 1356,
 1357,
 1360,
 1362,
 1365,
 1366,
 1367,
 1371,
 1372,
 1377,
 1380,
 1384,
 1386,
 1391,
 1394,
 1395,
 1398,
 1400,
 1405,
 1406,
 1408,
 1409,
 1410,
 1411,
 1413,
 1414,
 1415,
 1416,
 1419,
 1420,
 1421,
 1422,
 1423,
 1424,
 1425,
 1427,
 1428,
 1429,
 1430,
 1436,
 1440,
 1441,
 1442,
 1443,
 1444,
 1445,
 1446,
 1447,
 1448,
 1449,
 1450,
 1454,
 1458,
 1461,
 1462,
 1463,
 1465,
 1466,
 1467,
 1468,
 1469,
 1478,
 1480,
 1483,
 1484,
 1488,
 1489,
 1490,
 1492,
 1494,
 1496,
 1497,
 1499,
 1500,
 1502,
 1505,
 1511,
 1515,
 1516,
 1519,
 1521,
 1522,
 1530,
 1531,
 1532,
 1536,
 1537,
 1538,
 1539,
 1540,
 1543,
 1545,
 1546,
 1547,
 1549,
 1552,
 1554,
 1556,
 1558,
 1559,
 1560,
 1561,
 1565,
 1568,
 1570,
 1575,
 1576,
 1584,
 1585,
 1586,
 1591,
 1592,
 1593,
 1594,
 1595,
 1596,
 1598,
 1601,
 1603,
 1605,
 1607,
 1608,
 1609,
 1611,
 1612,
 1613,
 1614,
 1615,
 1617,
 1619,
 1621,
 1624,
 1626,
 1627,
 1628,
 1629,
 1630,
 1632,
 1633,
 1637,
 1639,
 1640,
 1642,
 1645,
 1647,
 1648,
 1649,
 1651,
 1652,
 1653,
 1654,
 1656,
 1658,
 1662,
 1663,
 1665,
 1667,
 1669,
 1672,
 1674,
 1676,
 1678,
 1681,
 1682,
 1683,
 1684,
 1685,
 1687,
 1689,
 1698,
 1700,
 1701,
 1702,
 1704,
 1706,
 1708,
 1709,
 1710,
 1711,
 1714,
 1716,
 1718,
 1719,
 1723,
 1724,
 1725,
 1729,
 1730,
 1733,
 1736,
 1737,
 1738,
 1739,
 1743,
 1745,
 1747,
 1748,
 1750,
 1753,
 1754,
 1755,
 1757,
 1758,
 1759,
 1761,
 1762,
 1763,
 1764,
 1766,
 1768,
 1771,
 1773,
 1775,
 1778,
 1780,
 1783,
 1784,
 1785,
 1791,
 1793,
 1794,
 1797,
 1798,
 1802,
 1804,
 1805,
 1809,
 1810,
 1811,
 1812,
 1815,
 1817,
 1819,
 1822,
 1823,
 1825,
 1826,
 1827,
 1832,
 1833,
 1834,
 1839,
 1841,
 1844,
 1846,
 1847,
 1851,
 1855,
 1856,
 1857,
 1858,
 1859,
 1860,
 1861,
 1863,
 1864,
 1865,
 1870,
 1875,
 1877,
 1879,
 1880,
 1883,
 1885,
 1887,
 1890,
 1892,
 1894,
 1898,
 1899,
 1900,
 1901,
 1904,
 1906,
 1910,
 1912,
 1913,
 1917,
 1919,
 1920,
 1921,
 1923,
 1925,
 1926,
 1928,
 1931,
 1933,
 1935,
 1937,
 1939,
 1941,
 1944,
 1945,
 1946,
 1948,
 ...]

In [9]:
enumerated_y


Out[9]:
[(0, 7),
 (1, 3),
 (2, 4),
 (3, 6),
 (4, 1),
 (5, 8),
 (6, 1),
 (7, 0),
 (8, 9),
 (9, 8),
 (10, 0),
 (11, 3),
 (12, 1),
 (13, 2),
 (14, 7),
 (15, 0),
 (16, 2),
 (17, 9),
 (18, 6),
 (19, 0),
 (20, 1),
 (21, 6),
 (22, 7),
 (23, 1),
 (24, 9),
 (25, 7),
 (26, 6),
 (27, 5),
 (28, 5),
 (29, 8),
 (30, 8),
 (31, 3),
 (32, 4),
 (33, 4),
 (34, 8),
 (35, 7),
 (36, 3),
 (37, 6),
 (38, 4),
 (39, 6),
 (40, 6),
 (41, 3),
 (42, 8),
 (43, 8),
 (44, 9),
 (45, 9),
 (46, 4),
 (47, 4),
 (48, 0),
 (49, 7),
 (50, 8),
 (51, 1),
 (52, 0),
 (53, 0),
 (54, 1),
 (55, 8),
 (56, 5),
 (57, 7),
 (58, 1),
 (59, 7),
 (60, 5),
 (61, 5),
 (62, 9),
 (63, 9),
 (64, 4),
 (65, 2),
 (66, 5),
 (67, 3),
 (68, 7),
 (69, 4),
 (70, 6),
 (71, 6),
 (72, 0),
 (73, 1),
 (74, 0),
 (75, 1),
 (76, 2),
 (77, 4),
 (78, 8),
 (79, 5),
 (80, 3),
 (81, 5),
 (82, 0),
 (83, 0),
 (84, 6),
 (85, 4),
 (86, 3),
 (87, 8),
 (88, 3),
 (89, 7),
 (90, 1),
 (91, 4),
 (92, 3),
 (93, 9),
 (94, 2),
 (95, 2),
 (96, 0),
 (97, 3),
 (98, 6),
 (99, 6),
 (100, 7),
 (101, 4),
 (102, 3),
 (103, 2),
 (104, 2),
 (105, 4),
 (106, 9),
 (107, 1),
 (108, 0),
 (109, 5),
 (110, 2),
 (111, 4),
 (112, 8),
 (113, 2),
 (114, 1),
 (115, 0),
 (116, 8),
 (117, 4),
 (118, 4),
 (119, 8),
 (120, 0),
 (121, 6),
 (122, 4),
 (123, 1),
 (124, 4),
 (125, 9),
 (126, 6),
 (127, 3),
 (128, 1),
 (129, 2),
 (130, 9),
 (131, 0),
 (132, 1),
 (133, 0),
 (134, 4),
 (135, 2),
 (136, 9),
 (137, 9),
 (138, 4),
 (139, 3),
 (140, 8),
 (141, 6),
 (142, 9),
 (143, 3),
 (144, 0),
 (145, 6),
 (146, 7),
 (147, 0),
 (148, 3),
 (149, 1),
 (150, 4),
 (151, 2),
 (152, 3),
 (153, 3),
 (154, 0),
 (155, 4),
 (156, 2),
 (157, 5),
 (158, 5),
 (159, 6),
 (160, 3),
 (161, 7),
 (162, 2),
 (163, 8),
 (164, 5),
 (165, 9),
 (166, 2),
 (167, 0),
 (168, 1),
 (169, 1),
 (170, 8),
 (171, 2),
 (172, 9),
 (173, 3),
 (174, 1),
 (175, 4),
 (176, 1),
 (177, 5),
 (178, 7),
 (179, 6),
 (180, 4),
 (181, 7),
 (182, 7),
 (183, 8),
 (184, 3),
 (185, 9),
 (186, 3),
 (187, 0),
 (188, 5),
 (189, 1),
 (190, 3),
 (191, 2),
 (192, 0),
 (193, 3),
 (194, 0),
 (195, 4),
 (196, 0),
 (197, 7),
 (198, 4),
 (199, 8),
 (200, 8),
 (201, 9),
 (202, 0),
 (203, 0),
 (204, 1),
 (205, 8),
 (206, 7),
 (207, 3),
 (208, 9),
 (209, 9),
 (210, 5),
 (211, 5),
 (212, 9),
 (213, 6),
 (214, 7),
 (215, 8),
 (216, 2),
 (217, 4),
 (218, 6),
 (219, 9),
 (220, 8),
 (221, 1),
 (222, 6),
 (223, 7),
 (224, 9),
 (225, 1),
 (226, 6),
 (227, 2),
 (228, 0),
 (229, 9),
 (230, 6),
 (231, 6),
 (232, 2),
 (233, 9),
 (234, 1),
 (235, 1),
 (236, 2),
 (237, 1),
 (238, 3),
 (239, 1),
 (240, 5),
 (241, 2),
 (242, 7),
 (243, 8),
 (244, 0),
 (245, 1),
 (246, 0),
 (247, 2),
 (248, 8),
 (249, 0),
 (250, 2),
 (251, 7),
 (252, 3),
 (253, 7),
 (254, 5),
 (255, 5),
 (256, 1),
 (257, 8),
 (258, 2),
 (259, 2),
 (260, 6),
 (261, 9),
 (262, 1),
 (263, 8),
 (264, 7),
 (265, 4),
 (266, 0),
 (267, 6),
 (268, 0),
 (269, 7),
 (270, 3),
 (271, 1),
 (272, 0),
 (273, 6),
 (274, 6),
 (275, 0),
 (276, 9),
 (277, 3),
 (278, 4),
 (279, 6),
 (280, 7),
 (281, 8),
 (282, 9),
 (283, 7),
 (284, 3),
 (285, 0),
 (286, 0),
 (287, 4),
 (288, 0),
 (289, 2),
 (290, 6),
 (291, 7),
 (292, 5),
 (293, 4),
 (294, 6),
 (295, 4),
 (296, 8),
 (297, 2),
 (298, 0),
 (299, 8),
 (300, 7),
 (301, 1),
 (302, 7),
 (303, 5),
 (304, 1),
 (305, 1),
 (306, 2),
 (307, 2),
 (308, 7),
 (309, 5),
 (310, 6),
 (311, 6),
 (312, 7),
 (313, 4),
 (314, 2),
 (315, 3),
 (316, 9),
 (317, 0),
 (318, 2),
 (319, 0),
 (320, 9),
 (321, 0),
 (322, 4),
 (323, 3),
 (324, 4),
 (325, 7),
 (326, 7),
 (327, 0),
 (328, 3),
 (329, 6),
 (330, 0),
 (331, 4),
 (332, 3),
 (333, 8),
 (334, 6),
 (335, 8),
 (336, 1),
 (337, 3),
 (338, 8),
 (339, 9),
 (340, 0),
 (341, 9),
 (342, 0),
 (343, 8),
 (344, 0),
 (345, 2),
 (346, 8),
 (347, 7),
 (348, 8),
 (349, 7),
 (350, 9),
 (351, 1),
 (352, 7),
 (353, 0),
 (354, 3),
 (355, 1),
 (356, 4),
 (357, 2),
 (358, 3),
 (359, 3),
 (360, 8),
 (361, 4),
 (362, 9),
 (363, 5),
 (364, 6),
 (365, 6),
 (366, 4),
 (367, 7),
 (368, 0),
 (369, 8),
 (370, 3),
 (371, 9),
 (372, 8),
 (373, 0),
 (374, 6),
 (375, 1),
 (376, 8),
 (377, 2),
 (378, 5),
 (379, 3),
 (380, 2),
 (381, 4),
 (382, 5),
 (383, 5),
 (384, 6),
 (385, 6),
 (386, 9),
 (387, 7),
 (388, 3),
 (389, 8),
 (390, 9),
 (391, 9),
 (392, 3),
 (393, 0),
 (394, 8),
 (395, 1),
 (396, 3),
 (397, 2),
 (398, 0),
 (399, 3),
 (400, 2),
 (401, 4),
 (402, 9),
 (403, 5),
 (404, 9),
 (405, 6),
 (406, 4),
 (407, 7),
 (408, 3),
 (409, 8),
 (410, 4),
 (411, 9),
 (412, 3),
 (413, 6),
 (414, 5),
 (415, 2),
 (416, 7),
 (417, 5),
 (418, 8),
 (419, 6),
 (420, 2),
 (421, 2),
 (422, 7),
 (423, 5),
 (424, 5),
 (425, 1),
 (426, 9),
 (427, 7),
 (428, 1),
 (429, 1),
 (430, 8),
 (431, 8),
 (432, 3),
 (433, 3),
 (434, 3),
 (435, 8),
 (436, 2),
 (437, 7),
 (438, 2),
 (439, 1),
 (440, 5),
 (441, 7),
 (442, 3),
 (443, 1),
 (444, 4),
 (445, 4),
 (446, 7),
 (447, 7),
 (448, 7),
 (449, 2),
 (450, 4),
 (451, 6),
 (452, 5),
 (453, 5),
 (454, 9),
 (455, 3),
 (456, 5),
 (457, 9),
 (458, 3),
 (459, 9),
 (460, 8),
 (461, 0),
 (462, 0),
 (463, 8),
 (464, 0),
 (465, 7),
 (466, 6),
 (467, 3),
 (468, 0),
 (469, 0),
 (470, 0),
 (471, 3),
 (472, 7),
 (473, 7),
 (474, 8),
 (475, 0),
 (476, 8),
 (477, 1),
 (478, 9),
 (479, 1),
 (480, 2),
 (481, 2),
 (482, 4),
 (483, 1),
 (484, 1),
 (485, 6),
 (486, 6),
 (487, 0),
 (488, 0),
 (489, 5),
 (490, 4),
 (491, 3),
 (492, 9),
 (493, 3),
 (494, 1),
 (495, 6),
 (496, 7),
 (497, 3),
 (498, 0),
 (499, 5),
 (500, 1),
 (501, 9),
 (502, 0),
 (503, 9),
 (504, 7),
 (505, 0),
 (506, 5),
 (507, 1),
 (508, 2),
 (509, 2),
 (510, 3),
 (511, 3),
 (512, 0),
 (513, 4),
 (514, 0),
 (515, 5),
 (516, 1),
 (517, 6),
 (518, 9),
 (519, 7),
 (520, 1),
 (521, 8),
 (522, 9),
 (523, 9),
 (524, 6),
 (525, 0),
 (526, 5),
 (527, 1),
 (528, 2),
 (529, 2),
 (530, 1),
 (531, 3),
 (532, 9),
 (533, 4),
 (534, 8),
 (535, 7),
 (536, 8),
 (537, 8),
 (538, 9),
 (539, 9),
 (540, 7),
 (541, 0),
 (542, 3),
 (543, 1),
 (544, 9),
 (545, 2),
 (546, 7),
 (547, 3),
 (548, 8),
 (549, 4),
 (550, 5),
 (551, 5),
 (552, 1),
 (553, 6),
 (554, 6),
 (555, 7),
 (556, 6),
 (557, 8),
 (558, 9),
 (559, 9),
 (560, 0),
 (561, 6),
 (562, 3),
 (563, 0),
 (564, 7),
 (565, 7),
 (566, 6),
 (567, 3),
 (568, 7),
 (569, 7),
 (570, 1),
 (571, 1),
 (572, 9),
 (573, 3),
 (574, 8),
 (575, 7),
 (576, 6),
 (577, 9),
 (578, 3),
 (579, 7),
 (580, 4),
 (581, 4),
 (582, 1),
 (583, 0),
 (584, 7),
 (585, 0),
 (586, 6),
 (587, 6),
 (588, 3),
 (589, 9),
 (590, 4),
 (591, 5),
 (592, 9),
 (593, 6),
 (594, 8),
 (595, 9),
 (596, 7),
 (597, 8),
 (598, 5),
 (599, 5),
 (600, 6),
 (601, 1),
 (602, 2),
 (603, 5),
 (604, 0),
 (605, 3),
 (606, 5),
 (607, 9),
 (608, 0),
 (609, 8),
 (610, 1),
 (611, 3),
 (612, 0),
 (613, 4),
 (614, 9),
 (615, 0),
 (616, 3),
 (617, 5),
 (618, 2),
 (619, 6),
 (620, 5),
 (621, 3),
 (622, 0),
 (623, 4),
 (624, 2),
 (625, 8),
 (626, 7),
 (627, 0),
 (628, 8),
 (629, 6),
 (630, 1),
 (631, 4),
 (632, 6),
 (633, 8),
 (634, 6),
 (635, 1),
 (636, 4),
 (637, 3),
 (638, 2),
 (639, 4),
 (640, 3),
 (641, 0),
 (642, 3),
 (643, 1),
 (644, 1),
 (645, 9),
 (646, 0),
 (647, 2),
 (648, 1),
 (649, 3),
 (650, 7),
 (651, 7),
 (652, 7),
 (653, 5),
 (654, 6),
 (655, 1),
 (656, 2),
 (657, 7),
 (658, 9),
 (659, 2),
 (660, 3),
 (661, 8),
 (662, 0),
 (663, 7),
 (664, 9),
 (665, 0),
 (666, 5),
 (667, 1),
 (668, 5),
 (669, 9),
 (670, 8),
 (671, 6),
 (672, 9),
 (673, 4),
 (674, 0),
 (675, 1),
 (676, 7),
 (677, 2),
 (678, 5),
 (679, 3),
 (680, 8),
 (681, 1),
 (682, 6),
 (683, 3),
 (684, 6),
 (685, 5),
 (686, 6),
 (687, 3),
 (688, 5),
 (689, 4),
 (690, 0),
 (691, 1),
 (692, 0),
 (693, 6),
 (694, 0),
 (695, 8),
 (696, 8),
 (697, 0),
 (698, 0),
 (699, 8),
 (700, 2),
 (701, 9),
 (702, 3),
 (703, 4),
 (704, 9),
 (705, 9),
 (706, 2),
 (707, 2),
 (708, 1),
 (709, 6),
 (710, 3),
 (711, 0),
 (712, 5),
 (713, 1),
 (714, 1),
 (715, 2),
 (716, 7),
 (717, 3),
 (718, 9),
 (719, 5),
 (720, 4),
 (721, 6),
 (722, 2),
 (723, 7),
 (724, 2),
 (725, 8),
 (726, 9),
 (727, 9),
 (728, 3),
 (729, 0),
 (730, 0),
 (731, 1),
 (732, 1),
 (733, 2),
 (734, 4),
 (735, 4),
 (736, 3),
 (737, 5),
 (738, 3),
 (739, 6),
 (740, 9),
 (741, 7),
 (742, 5),
 (743, 8),
 (744, 2),
 (745, 9),
 (746, 9),
 (747, 0),
 (748, 3),
 (749, 1),
 (750, 6),
 (751, 2),
 (752, 5),
 (753, 3),
 (754, 7),
 (755, 4),
 (756, 1),
 (757, 5),
 (758, 2),
 (759, 6),
 (760, 1),
 (761, 7),
 (762, 2),
 (763, 8),
 (764, 4),
 (765, 9),
 (766, 6),
 (767, 0),
 (768, 7),
 (769, 7),
 (770, 3),
 (771, 5),
 (772, 6),
 (773, 0),
 (774, 6),
 (775, 8),
 (776, 5),
 (777, 4),
 (778, 7),
 (779, 1),
 (780, 6),
 (781, 8),
 (782, 6),
 (783, 8),
 (784, 7),
 (785, 1),
 (786, 7),
 (787, 3),
 (788, 3),
 (789, 1),
 (790, 2),
 (791, 8),
 (792, 4),
 (793, 3),
 (794, 9),
 (795, 7),
 (796, 4),
 (797, 9),
 (798, 3),
 (799, 3),
 (800, 8),
 (801, 0),
 (802, 6),
 (803, 9),
 (804, 6),
 (805, 4),
 (806, 9),
 (807, 4),
 (808, 0),
 (809, 0),
 (810, 6),
 (811, 7),
 (812, 3),
 (813, 4),
 (814, 1),
 (815, 2),
 (816, 2),
 (817, 9),
 (818, 7),
 (819, 8),
 (820, 3),
 (821, 7),
 (822, 4),
 (823, 2),
 (824, 1),
 (825, 7),
 (826, 6),
 (827, 8),
 (828, 5),
 (829, 9),
 (830, 0),
 (831, 3),
 (832, 6),
 (833, 1),
 (834, 1),
 (835, 4),
 (836, 9),
 (837, 6),
 (838, 3),
 (839, 5),
 (840, 1),
 (841, 2),
 (842, 1),
 (843, 2),
 (844, 0),
 (845, 2),
 (846, 6),
 (847, 5),
 (848, 6),
 (849, 6),
 (850, 1),
 (851, 7),
 (852, 3),
 (853, 8),
 (854, 4),
 (855, 7),
 (856, 5),
 (857, 5),
 (858, 3),
 (859, 1),
 (860, 9),
 (861, 6),
 (862, 1),
 (863, 4),
 (864, 1),
 (865, 9),
 (866, 5),
 (867, 2),
 (868, 9),
 (869, 9),
 (870, 3),
 (871, 3),
 (872, 5),
 (873, 5),
 (874, 9),
 (875, 3),
 (876, 1),
 (877, 6),
 (878, 9),
 (879, 6),
 (880, 4),
 (881, 0),
 (882, 1),
 (883, 0),
 (884, 0),
 (885, 2),
 (886, 0),
 (887, 5),
 (888, 0),
 (889, 6),
 (890, 2),
 (891, 4),
 (892, 9),
 (893, 9),
 (894, 8),
 (895, 2),
 (896, 8),
 (897, 7),
 (898, 9),
 (899, 4),
 (900, 2),
 (901, 9),
 (902, 2),
 (903, 1),
 (904, 5),
 (905, 0),
 (906, 7),
 (907, 2),
 (908, 2),
 (909, 2),
 (910, 6),
 (911, 3),
 (912, 7),
 (913, 6),
 (914, 2),
 (915, 1),
 (916, 8),
 (917, 8),
 (918, 9),
 (919, 3),
 (920, 6),
 (921, 0),
 (922, 3),
 (923, 3),
 (924, 9),
 (925, 5),
 (926, 3),
 (927, 0),
 (928, 2),
 (929, 0),
 (930, 1),
 (931, 6),
 (932, 0),
 (933, 1),
 (934, 5),
 (935, 6),
 (936, 4),
 (937, 9),
 (938, 0),
 (939, 5),
 (940, 9),
 (941, 3),
 (942, 3),
 (943, 9),
 (944, 4),
 (945, 4),
 (946, 7),
 (947, 5),
 (948, 6),
 (949, 8),
 (950, 1),
 (951, 6),
 (952, 2),
 (953, 7),
 (954, 4),
 (955, 1),
 (956, 6),
 (957, 1),
 (958, 3),
 (959, 7),
 (960, 4),
 (961, 0),
 (962, 6),
 (963, 1),
 (964, 9),
 (965, 2),
 (966, 1),
 (967, 3),
 (968, 7),
 (969, 4),
 (970, 3),
 (971, 5),
 (972, 8),
 (973, 6),
 (974, 3),
 (975, 7),
 (976, 7),
 (977, 8),
 (978, 0),
 (979, 9),
 (980, 3),
 (981, 0),
 (982, 4),
 (983, 1),
 (984, 5),
 (985, 2),
 (986, 7),
 (987, 3),
 (988, 2),
 (989, 4),
 (990, 6),
 (991, 5),
 (992, 9),
 (993, 6),
 (994, 1),
 (995, 7),
 (996, 6),
 (997, 8),
 (998, 6),
 (999, 9),
 ...]

In [10]:
X_masked_train = X_train[indices]

In [11]:
y_masked_train = y_train[indices]

In [12]:
y_masked_train.shape


Out[12]:
(28038,)

In [13]:
X_masked_train.shape


Out[13]:
(28038, 784)