]> git.rustad.me Git - hexagonal/commitdiff
Second commit master
authorBjørn Rustad <bjorn@rustad.me>
Sat, 22 Dec 2018 18:14:58 +0000 (19:14 +0100)
committerBjørn Rustad <bjorn@rustad.me>
Sat, 22 Dec 2018 18:14:58 +0000 (19:14 +0100)
best/11
best/12
best/13
best/14
best/16
best/18
best/23
hexagonal.cpp
hexazero/Untitled.ipynb [new file with mode: 0644]

diff --git a/best/11 b/best/11
index 7e7c2b94f9fe50c0516ab58b0e56864de10a3ae9..15509ae74ba5e6618db49c1a5e28c0caad89981e 100644 (file)
--- a/best/11
+++ b/best/11
@@ -1,2 +1,2 @@
-896
-(4,2,4,3,1,2,5,1,5,4,1), (1,3,1,5,2,6,4,3,2,3,2,5), (5,4,7,2,6,3,5,1,6,5,1,4,3), (3,2,6,5,4,1,6,2,7,4,2,6,1,2), (5,1,3,1,3,2,7,4,5,3,1,3,5,6,3), (4,2,6,5,4,7,5,3,1,6,2,7,4,2,4,1), (3,1,4,7,2,6,1,4,2,7,4,6,5,1,6,5,3), (5,2,7,3,1,3,5,6,7,5,3,1,3,2,3,7,2,5), (1,4,6,5,2,5,4,2,3,1,4,2,7,5,7,4,1,4,1), (2,6,3,1,4,6,7,1,4,7,6,5,6,4,1,6,2,3,5,2), (3,7,5,2,3,1,3,2,7,5,2,3,1,3,2,3,5,7,6,1,3), (1,4,1,5,7,6,4,6,3,1,4,5,7,6,5,4,1,4,2,4), (3,2,3,4,2,5,1,5,2,6,7,2,4,1,6,2,5,3,5), (4,5,6,1,3,6,7,4,5,3,1,3,5,7,3,7,6,1), (1,7,2,5,4,2,3,1,6,2,4,7,2,4,1,4,2), (3,4,6,7,1,6,5,4,7,5,6,1,7,6,3,5), (2,1,3,2,4,7,2,3,1,3,2,3,5,2,1), (1,4,7,5,3,1,4,5,6,7,5,4,1,3), (2,6,1,6,2,7,6,2,4,1,7,2,4), (3,5,4,7,5,3,1,3,5,6,3,5), (1,2,3,1,4,2,4,1,2,4,1)
+885
+(1,3,2,3,4,2,3,5,2,1,2), (5,4,5,1,5,1,5,1,4,6,3,4), (3,2,7,3,2,7,4,2,3,5,2,6,1), (1,5,1,6,5,6,3,1,4,7,1,5,3,4), (2,6,4,2,4,1,4,2,5,6,2,6,4,2,1), (4,7,3,1,3,2,5,7,6,3,1,3,7,1,6,3), (3,1,5,2,5,4,6,3,1,4,2,7,5,2,4,5,2), (1,2,6,4,7,6,1,7,2,6,5,6,4,1,3,6,1,2), (3,4,7,3,1,3,2,4,5,7,3,1,3,2,4,7,2,6,3), (2,7,1,5,2,4,6,7,3,1,4,2,4,7,6,5,1,5,4,1), (1,5,6,4,7,6,5,1,5,2,5,7,6,5,1,3,2,3,6,2,4), (4,3,2,3,1,3,2,7,4,7,3,1,3,2,5,6,4,7,1,3), (2,1,4,6,7,4,6,3,1,6,2,5,4,4,7,1,5,2,5), (2,6,5,2,5,1,5,2,4,5,3,7,1,3,2,7,3,4), (1,3,1,7,3,4,7,3,6,1,6,2,4,5,6,4,1), (4,2,4,6,2,6,1,7,2,4,5,6,7,1,3,2), (5,3,5,1,3,5,4,5,6,3,1,3,2,4,5), (1,2,6,4,6,2,3,1,7,2,4,6,5,1), (5,3,7,2,1,6,5,4,5,6,1,7,3), (4,1,5,1,4,7,2,3,1,3,4,2), (2,4,3,2,3,1,4,5,2,5,1)
diff --git a/best/12 b/best/12
index 56d77421d53e0be3244700789a5dd1a91257b96b..748377c469776d937cecc9e8bd3c5d46b0bae7f5 100644 (file)
--- a/best/12
+++ b/best/12
@@ -1,2 +1,2 @@
-1088
-(4,3,1,3,4,1,2,3,1,3,2,1), (1,2,5,4,2,3,1,6,5,4,5,6,3), (3,4,7,6,1,5,7,4,7,2,6,1,4,2), (2,6,1,3,2,4,6,2,3,1,3,7,5,6,1), (1,7,5,4,5,6,3,1,4,7,6,4,2,3,1,2), (5,4,3,2,7,1,7,2,6,5,2,5,1,5,6,4,5), (3,2,5,1,3,6,4,5,7,3,1,3,6,4,7,2,3,1), (4,1,6,7,4,5,2,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1,1,7,6,5,3,4,2,1,2,4,6,3,7,2,1,7,6,3,4,6,2), (2,5,2,1,2,6,5,3,7,5,1,2,5,4,3,5,2,1,2,7,3), (4,3,6,4,7,1,6,4,6,3,4,6,1,7,6,4,3,6,5,1), (1,5,7,3,5,7,2,1,2,5,7,3,5,2,1,5,7,4,3), (4,2,1,2,4,3,5,4,7,1,2,4,7,3,6,2,1,2), (3,5,3,6,1,7,6,3,6,5,6,1,6,4,7,5,1), (1,4,5,7,4,2,1,2,4,3,7,5,2,1,3,4), (2,1,2,3,5,7,3,6,1,2,4,3,7,4,2), (3,6,5,1,6,4,7,5,3,5,1,6,5,1), (1,4,6,3,2,1,2,4,6,7,4,2,3), (3,2,1,4,5,3,5,1,2,3,1,4)
diff --git a/best/13 b/best/13
index a65b03cb2be7aee64c6ec84bfaaeebb693137d15..730adf752f2390956ad1bb8ab92e07fde475d8e0 100644 (file)
--- a/best/13
+++ b/best/13
@@ -1,2 +1,2 @@
-1288
-(4,2,1,2,5,1,3,2,1,2,3,1,2), (1,3,6,4,3,4,1,5,7,6,5,6,4,5), (5,4,5,7,1,2,7,6,4,3,4,1,2,3,1), (3,2,1,2,3,4,5,3,2,1,2,5,6,7,5,2), (1,4,7,6,5,7,6,1,7,5,7,6,3,4,1,4,5), (2,6,5,3,4,1,2,3,6,4,3,4,1,2,6,7,3,1), (5,3,2,1,2,5,6,7,5,2,1,2,6,5,3,5,2,1,2), (4,1,4,5,7,6,3,4,1,4,5,7,3,7,4,1,4,7,5,3), (2,3,7,6,3,4,1,2,7,5,3,6,4,1,2,6,7,3,6,4,1), (1,6,5,2,1,2,6,5,3,6,2,1,2,7,6,3,5,2,1,2,7,3), (3,4,1,4,5,7,3,7,4,1,4,6,5,3,5,4,1,4,6,3,6,5,2), (1,2,5,6,3,6,4,1,2,5,7,3,7,4,1,2,7,3,7,5,4,1,4,1), (2,5,3,7,2,1,2,6,7,3,6,2,1,2,5,3,5,6,2,1,2,6,3,5,2), (1,4,1,4,5,7,3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,4,1,2,5,6,3,5,2,1,2,6,3,1), (2,1,2,5,3,7,6,2,1,2,7,5,3,7,2,1,4,5,3,7,5,4), (4,3,6,7,2,1,4,6,5,3,6,4,1,4,7,3,7,6,4,1,2), (1,4,1,4,7,6,3,7,4,1,2,6,3,6,5,2,1,2,6,2), (2,7,6,3,5,2,1,2,5,3,5,7,2,1,4,3,4,5,3), (3,5,2,1,4,7,3,6,7,4,1,4,3,6,5,6,7,1), (1,4,7,3,5,6,4,1,2,7,6,5,7,2,1,2,3), (3,6,5,2,1,2,6,7,5,3,2,1,4,3,4,5), (2,1,4,3,4,5,3,4,1,6,5,7,6,5,1), (3,6,5,6,7,1,2,5,7,4,3,2,1,2), (1,2,1,2,3,4,1,3,2,1,4,5,3)
diff --git a/best/14 b/best/14
index a2f476af9f2844825e1e3686765b248ce49dfe3f..34f034167a73e0bf174e7ab75f7cb57c60b8f6a3 100644 (file)
--- a/best/14
+++ b/best/14
@@ -1,2 +1,2 @@
-1512
-(2,3,5,2,1,2,5,1,4,3,5,1,4,2), (1,4,1,4,6,5,3,4,2,1,2,4,3,5,1), (3,2,7,6,3,7,4,1,5,6,3,7,6,2,1,2), (1,4,3,5,2,1,2,6,3,7,4,5,1,5,4,7,3), (3,5,6,1,4,5,3,7,5,2,1,2,6,7,3,5,6,1), (2,1,2,7,3,7,6,4,1,4,7,5,3,4,2,1,2,4,3), (1,5,3,5,4,2,1,2,5,6,3,6,4,1,7,5,3,7,5,2), (3,4,6,7,1,6,7,5,3,7,2,1,2,6,3,6,4,6,1,6,1), (5,2,1,2,4,5,3,4,6,1,4,7,3,7,5,2,1,2,5,4,3,4), (1,4,5,6,3,7,2,1,2,7,3,6,5,4,1,4,7,6,3,6,2,1,2), (2,5,3,7,4,1,6,5,3,5,4,2,1,2,5,6,3,5,4,1,7,4,3,4), (3,6,2,1,2,6,3,4,7,6,1,6,7,4,3,7,2,1,2,5,3,5,6,7,1), (5,1,4,6,3,7,5,2,1,2,4,5,3,5,7,1,4,5,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,4,6,2,6,1,4,1), (4,3,4,2,7,1,6,2,4,6,2,3,1,3,2,4,5,2,3,1,3,7,5,6,2), (5,2,5,1,5,6,4,7,5,7,1,5,7,4,5,6,7,1,6,7,5,4,2,3,1,3), (3,1,6,7,4,3,2,3,1,3,2,4,6,2,7,1,3,2,5,4,2,6,1,7,6,4,1), (2,4,3,2,5,1,6,2,4,5,7,3,1,3,6,4,6,7,3,1,3,7,4,5,2,5), (1,5,1,7,6,4,5,6,7,1,6,2,7,5,2,5,1,4,2,7,5,2,3,1,3), (4,2,4,3,2,3,1,3,2,4,5,6,4,1,3,6,7,5,6,4,1,7,4,5), (3,6,5,1,4,5,6,7,5,3,1,3,2,6,4,2,3,1,3,2,6,5,2), (1,7,2,7,6,2,4,1,7,2,7,4,7,5,1,6,4,6,5,4,3,1), (3,4,5,3,1,3,5,6,4,6,5,1,3,2,5,7,2,7,1,5,2), (2,1,7,2,4,6,2,3,1,3,2,7,5,4,3,1,3,4,6,1), (1,4,6,5,7,1,7,4,7,5,4,6,1,7,2,5,6,2,3), (2,3,1,3,2,5,6,2,6,1,3,2,5,6,4,7,1,4), (5,4,6,7,4,3,1,3,4,7,5,4,3,1,3,2,3), (1,2,5,1,6,2,5,6,2,6,1,6,2,6,7,4), (4,3,4,5,7,4,7,1,3,4,5,7,4,5,1), (2,1,2,3,1,3,2,4,1,2,3,1,3,2)
diff --git a/best/16 b/best/16
index ab8ea4efbe6e6afe862feb2ac5f4f704e1561a96..7661648bf47262be1008ee99636e397e1b92cfa9 100644 (file)
--- a/best/16
+++ b/best/16
@@ -1,2 +1,2 @@
-2011
-(1,1,2,5,3,2,1,2,3,1,3,5,2,1,2,1), (5,4,3,4,1,7,5,7,6,5,2,1,4,7,6,3,4), (3,2,1,2,3,6,4,3,4,1,4,6,5,3,5,4,1,2), (1,4,5,7,6,5,2,1,2,5,7,3,7,2,1,2,5,6,3), (3,7,6,3,4,1,4,6,5,3,6,2,1,4,6,5,3,7,4,1), (2,5,2,1,2,7,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), (5,3,7,1,6,4,3,2,4,6,1,7,5,3,2,5,6,1,7,4,2,3,4,7,1,5,3,2,5,3), (4,2,5,3,5,1,6,7,3,2,4,6,1,6,4,3,2,6,5,1,5,7,2,3,4,7,1,4,1), (1,6,4,2,6,4,5,1,6,5,3,2,7,5,1,5,4,3,2,4,6,1,5,6,2,6,3,5), (3,7,1,7,3,2,3,4,7,1,5,4,3,2,7,6,1,7,6,3,2,4,7,1,5,4,2), (2,5,4,5,1,5,7,2,3,6,7,1,5,4,3,2,4,5,1,7,6,3,2,3,7,1), (1,3,2,6,4,6,1,5,4,2,3,6,7,1,5,7,3,2,4,5,1,4,5,6,2), (4,1,7,3,2,3,7,6,1,5,4,2,3,4,6,1,5,7,3,2,6,7,1,4), (2,4,5,1,6,4,2,3,6,7,1,6,7,2,3,4,6,1,6,5,3,2,3), (3,7,2,7,5,1,7,4,2,3,4,5,1,7,6,2,3,7,4,1,4,5), (1,6,4,3,2,5,6,1,5,7,2,3,4,5,1,6,5,2,3,5,1), (3,5,1,7,4,3,2,4,6,1,5,6,2,3,7,4,1,6,7,2), (2,3,5,6,1,7,5,3,2,4,7,1,6,5,2,3,5,4,1), (1,4,2,3,4,6,1,7,5,3,2,7,4,1,7,6,2,3), (2,1,5,6,2,3,4,6,1,4,5,3,2,5,4,1,3), (3,4,2,1,4,1,2,3,5,2,1,4,1,3,2,4)
diff --git a/best/18 b/best/18
index 8cf24b54cb76c042fdad5b2d2b4d9561d70542f4..55ebdb4df7f90650790dcf1f3134fc40466461c6 100644 (file)
--- a/best/18
+++ b/best/18
@@ -1,2 +1,2 @@
-2590
-(2,3,1,3,2,1,4,2,5,1,3,2,1,4,2,5,1,2), (1,5,4,7,6,4,3,1,3,4,6,5,4,3,1,3,4,4,3), (4,7,6,2,5,1,6,2,5,7,2,7,1,7,2,6,5,2,7,1), (3,2,3,1,3,4,5,7,4,6,1,3,4,5,6,4,7,1,6,5,3), (4,1,5,4,6,7,2,3,1,3,2,7,5,2,3,1,3,2,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,2,4,3), (2,3,5,7,1,6,7,2,3,7,5,1,6,4,3,2,7,5,1,6,7,3,2,4,5,1,6,5,2,3,5,7,1), (5,1,6,4,2,3,4,5,1,6,4,3,2,7,6,1,6,4,3,2,4,6,1,7,6,2,3,4,6,1,6,3), (4,2,3,6,5,1,7,6,3,2,7,5,1,5,4,3,2,5,7,1,7,5,2,3,4,6,1,5,7,4,2), (3,1,1,7,4,3,2,4,5,1,6,4,3,2,7,6,1,6,4,2,3,4,7,1,7,5,3,2,3,1), (5,4,3,2,5,7,1,7,6,3,2,6,7,1,5,4,2,3,5,6,1,5,6,3,2,4,5,1,4), (2,6,7,1,6,4,3,2,4,7,1,5,4,2,3,7,5,1,7,4,3,2,4,5,1,7,6,2), (1,5,4,3,2,5,7,1,5,6,2,3,7,5,1,6,4,3,2,5,6,1,7,6,2,3,4), (3,2,6,7,1,6,4,2,3,4,6,1,6,4,3,2,5,6,1,7,4,2,3,4,5,1), (5,1,5,4,2,3,6,5,1,5,7,3,2,7,5,1,7,4,2,3,6,5,1,6,1), (4,2,3,6,5,1,7,4,3,2,4,5,1,6,4,2,3,5,6,1,7,4,3,2), (3,1,1,2,4,3,2,1,4,1,3,2,2,3,1,4,1,2,4,3,2,1,4)
index 69478348750f027dd21f835477e3bcb8d2a60383..8b1aa9ea8d6694f38c03a1042fae886a882648c3 100644 (file)
@@ -15,12 +15,10 @@ public:
        int n;
 
        vector<vector<int>> data;
        int n;
 
        vector<vector<int>> data;
-       std::random_device rd;
-       std::minstd_rand rng;
        vector<vector<vector<pair<int, int>>>> memory;
        vector<pair<int, int>> indices;
 
        vector<vector<vector<pair<int, int>>>> memory;
        vector<pair<int, int>> indices;
 
-       Hexagon(int n) : n(n), data(n * 2 - 1, vector<int>(0)), rng(rd()) {
+       Hexagon(int n) : n(n), data(n * 2 - 1, vector<int>(0)) {
                init_ones();
                for (int row = 0; row < data.size(); ++row) {
                        vector<vector<pair<int, int>>> plo;
                init_ones();
                for (int row = 0; row < data.size(); ++row) {
                        vector<vector<pair<int, int>>> plo;
@@ -33,6 +31,15 @@ public:
                }
        }
 
                }
        }
 
+       bool all_ok() {
+               for (auto&& idx : indices) {
+                       if (!allowed_pos(idx)) {
+                               return false;
+                       }
+               }
+               return true;
+       }
+
        void init_ones() {
                int row_len = n;
                for (int i = 0; i < n * 2 - 1; ++i) {
        void init_ones() {
                int row_len = n;
                for (int i = 0; i < n * 2 - 1; ++i) {
@@ -265,22 +272,30 @@ public:
                //return allowed(data[row][col], neigh);
        }
 
                //return allowed(data[row][col], neigh);
        }
 
-       pair<int, int> rand_idx() {
-               uniform_int_distribution<int> row_dist(0, n * 2 - 1 - 1);
-               int row = row_dist(rng);
-               uniform_int_distribution<int> col_dist(0, data[row].size() - 1);
-               int col = col_dist(rng);
-               return make_pair(row, col);
-       }
+       //pair<int, int> rand_idx(std::ministd_rand rng) {
+       //      uniform_int_distribution<int> row_dist(0, n * 2 - 1 - 1);
+       //      int row = row_dist(rng);
+       //      uniform_int_distribution<int> col_dist(0, data[row].size() - 1);
+       //      int col = col_dist(rng);
+       //      return make_pair(row, col);
+       //}
 
        void jiggle() {
                for (int row = 0; row < data.size(); ++row) {
                        for (int col = 0; col < data[row].size(); ++col) {
 
        void jiggle() {
                for (int row = 0; row < data.size(); ++row) {
                        for (int col = 0; col < data[row].size(); ++col) {
-                               if (data[row][col] > 1) data[row][col] -= 1;
+                               if (data[row][col] == 7 || data[row][col] == 6) data[row][col] -= 1;
                        }
                }
        }
 
                        }
                }
        }
 
+       int try_fine_tune() {
+               Hexagon copy = *this;
+               copy.fine_tune();
+               copy.fine_tune();
+               copy.fine_tune();
+               return copy.get_score();
+       }
+
        void fine_tune() {
                vector<pair<int, int>> idxs;
                for (int row = 0; row < data.size(); ++row) {
        void fine_tune() {
                vector<pair<int, int>> idxs;
                for (int row = 0; row < data.size(); ++row) {
@@ -341,14 +356,17 @@ int main(int argc, char *argv[]) {
                cout << "Not enough arguments." << endl;
                return 1;
        }
                cout << "Not enough arguments." << endl;
                return 1;
        }
+       std::random_device rd;
+       std::minstd_rand rng(rd());
        int n = atoi(argv[1]);
        int decrease = floor(0.5 * pow(10, atoi(argv[2])));
        int lowest_cutoff = atoi(argv[3]);
        int read_file = atoi(argv[4]);
        int n = atoi(argv[1]);
        int decrease = floor(0.5 * pow(10, atoi(argv[2])));
        int lowest_cutoff = atoi(argv[3]);
        int read_file = atoi(argv[4]);
-       int cutoff = atoi(argv[5]);
+       float cutoff = atoi(argv[5]);
        int heatup = atoi(argv[6]);
        int cut_max = atoi(argv[7]);
        int shutdown = atoi(argv[8]);
        int heatup = atoi(argv[6]);
        int cut_max = atoi(argv[7]);
        int shutdown = atoi(argv[8]);
+       int timeout = atoi(argv[9]);
        long last = 35000000000;
        Hexagon hexagon(n);
        string filename = "best/" + to_string(n);
        long last = 35000000000;
        Hexagon hexagon(n);
        string filename = "best/" + to_string(n);
@@ -367,11 +385,13 @@ int main(int argc, char *argv[]) {
 
        int score = hexagon.get_score();
        int best_score = score;
 
        int score = hexagon.get_score();
        int best_score = score;
+       int best_notune = score;
        int subtractor = 3 * n * n - 3 * n + 1;
        long num = 0;
        int heatup_mult = 1;
        int same_score = 0;
        int subtractor = 3 * n * n - 3 * n + 1;
        long num = 0;
        int heatup_mult = 1;
        int same_score = 0;
-       int non_improvement = 0;
+       long non_improvement = 0;
+       uniform_int_distribution<int> move_dist(0, 10);
        uniform_int_distribution<int> add_dist(1, 10);
        uniform_int_distribution<int> cut_dist(0, cut_max);
        uniform_int_distribution<int> jiggle_dist(0, 500000000);
        uniform_int_distribution<int> add_dist(1, 10);
        uniform_int_distribution<int> cut_dist(0, cut_max);
        uniform_int_distribution<int> jiggle_dist(0, 500000000);
@@ -392,25 +412,25 @@ int main(int argc, char *argv[]) {
        //              cout << "WOOO SAVED THIS COOL BEST" << endl;
        //      }
        //}
        //              cout << "WOOO SAVED THIS COOL BEST" << endl;
        //      }
        //}
+       bool optimized = false;
+       int last_gjigle = 0;
+       vector<int> scores;
        while (true) {
                num += 1;
        while (true) {
                num += 1;
-               if (num % 10000000 == 0) {
+               if (num % 30000000 == 0) {
                        cout << "N = " << n << " score = " << score - subtractor << " cutoff " << cutoff << endl;
                }
                        cout << "N = " << n << " score = " << score - subtractor << " cutoff " << cutoff << endl;
                }
-               if (iter > idxs.size() / 2) {
+               if (iter > idxs.size() / 10) {
                        iter = 0;
                        random_shuffle(idxs.begin(), idxs.end());
                }
                pair<int, int> p = idxs[iter];
                iter += 1;
                        iter = 0;
                        random_shuffle(idxs.begin(), idxs.end());
                }
                pair<int, int> p = idxs[iter];
                iter += 1;
-               int cut = cut_dist(hexagon.rng);
-               int add = max(add_dist(hexagon.rng) / 4, 1);
-               if (jiggle_dist(hexagon.rng) == 0 && jiggle_dist(hexagon.rng) == 0) {
-                       cout << "JIGGLING" << endl;
-                       hexagon.jiggle();
-                       score = hexagon.get_score();
-               }
+               int cut = cut_dist(rng);
+               int add = 1; //max(add_dist(hexagon.rng) / 4, 1);
                int prev_value = hexagon.data[p.first][p.second];
                int prev_value = hexagon.data[p.first][p.second];
+               const vector<pair<int, int>>& idxs =
+                       hexagon.get_neighbors_idx(p);
                if (cut <= cutoff) {
                        if (hexagon.data[p.first][p.second] - add <= 0) {
                                continue;
                if (cut <= cutoff) {
                        if (hexagon.data[p.first][p.second] - add <= 0) {
                                continue;
@@ -421,12 +441,16 @@ int main(int argc, char *argv[]) {
                        if (hexagon.data[p.first][p.second] + add > 7) {
                                continue;
                        }
                        if (hexagon.data[p.first][p.second] + add > 7) {
                                continue;
                        }
+                       if (hexagon.data[p.first][p.second] + add == 7) {
+                               if (cutoff > 200) continue;
+                       }
+                       if (hexagon.data[p.first][p.second] + add == 6) {
+                               if (cutoff > 300) continue;
+                       }
                        hexagon.data[p.first][p.second] += add;
                        score += add;
                }
                int new_value = hexagon.data[p.first][p.second];
                        hexagon.data[p.first][p.second] += add;
                        score += add;
                }
                int new_value = hexagon.data[p.first][p.second];
-               const vector<pair<int, int>>& idxs =
-                       hexagon.get_neighbors_idx(p);
                bool ok = true;
                if (!hexagon.allowed_pos(p)) {
                        ok = false;
                bool ok = true;
                if (!hexagon.allowed_pos(p)) {
                        ok = false;
@@ -448,48 +472,72 @@ int main(int argc, char *argv[]) {
                        non_improvement += 1;
                } else {
                        same_score = 0;
                        non_improvement += 1;
                } else {
                        same_score = 0;
+                       scores.push_back(score);
                }
                }
-               if (same_score >= 35000) {
-                       same_score = 0;
-                       cutoff += heatup * heatup_mult;
-                       heatup_mult += 1;
-                       if (heatup_mult > 4) heatup_mult = 1;
-                       score = hexagon.get_score();
-                       cout << "N = " << n << ", Heating up again! " << cutoff << endl;
-                       return 0;
+               if (same_score > 500) {
+                       last_gjigle += 1;
+                       if (last_gjigle > 10000000000000) {
+                               cout << "Gjigle" << endl;
+                               hexagon.jiggle();
+                               score = hexagon.get_score();
+                               last_gjigle = 0;
+                       }
                }
                }
-               if (same_score >= 36000) {
-                       same_score = 0;
-                       hexagon.jiggle();
-                       score = hexagon.get_score();
-                       cout << "Jiggling!" << endl;
+               if (non_improvement % 13371 == 0) {
+                       last_gjigle += 1;
+                       if (last_gjigle > 50000) {
+                               cout << "Gjigle" << endl;
+                               hexagon.jiggle();
+                               score = hexagon.get_score();
+                               last_gjigle = 0;
+                       }
                }
                }
-               if (score - subtractor > float(all_time_best) * 0.95 && num % 200000000 == 0) {
-                       hexagon.fine_tune();
-                       score = hexagon.get_score();
-                       cout << "Finetuning just because: " << score - subtractor << endl;
+               if (same_score >= 3500 || non_improvement > 50000000000) {
+                       return 0;
                }
                }
-               if (score > best_score) {
-                       non_improvement = 0;
-                       while (score > best_score && score - subtractor > float(all_time_best) * 0.95) {
-                               cout << "Finetuning" << endl;
-                               int before = score;
+               //if (!optimized && score - subtractor > all_time_best - 5) {
+               //      hexagon.optimize_all();
+               //      score = hexagon.get_score();
+               //      optimized = true;
+               //}
+               //if (score - subtractor > float(all_time_best) * 0.95 && num % 400000000 == 0) {
+               //      hexagon.fine_tune();
+               //      score = hexagon.get_score();
+               //      cout << "Finetuning just because: " << score - subtractor << endl;
+               //}
+               if (score >= best_notune && score - subtractor >= float(all_time_best) * 0.94) {
+                       int possibly = hexagon.try_fine_tune();
+                       if (possibly - subtractor >= all_time_best) {
+                               hexagon.fine_tune();
+                               hexagon.fine_tune();
                                hexagon.fine_tune();
                                score = hexagon.get_score();
                                hexagon.fine_tune();
                                score = hexagon.get_score();
-                               while (score - before > 0) {
-                                       cout << "FINETUNING: " << score - before << ": ";
-                                       cout << score - subtractor << endl;
-                                       before = score;
-                                       hexagon.fine_tune();
-                                       score = hexagon.get_score();
-                               }
-                               best_score = score;
                        }
                        }
+               }
+               if (score > best_score) {
+               //if (score - subtractor >= all_time_best) {
+                       best_notune = score;
+                       non_improvement = 0;
+                       //while (score > best_score && score - subtractor > float(all_time_best) * 0.95) {
+                       //      cout << "Finetuning" << endl;
+                       //      int before = score;
+                       //      hexagon.fine_tune();
+                       //      score = hexagon.get_score();
+                       //      while (score - before > 0) {
+                       //              cout << "FINETUNING: " << score - before << ": ";
+                       //              cout << score - subtractor << endl;
+                       //              before = score;
+                       //              hexagon.fine_tune();
+                       //              score = hexagon.get_score();
+                       //      }
+                       //      best_score = score;
+                       //}
                        best_score = score;
                        best_score = score;
+                       optimized = false;
                        if (score - subtractor > all_time_best) {
                                int b = score;
                        if (score - subtractor > all_time_best) {
                                int b = score;
-                               cout << "TO OPTIMIZE " << endl;
-                               hexagon.optimize_all();
+                               //cout << "TO OPTIMIZE " << endl;
+                               //hexagon.optimize_all();
                                score = hexagon.get_score();
                                cout << "DONE: " << score - b << endl;
                                all_time_best = score - subtractor;
                                score = hexagon.get_score();
                                cout << "DONE: " << score - b << endl;
                                all_time_best = score - subtractor;
@@ -499,14 +547,26 @@ int main(int argc, char *argv[]) {
                        }
                        cout << "Cutoff now: " << cutoff << endl;
                }
                        }
                        cout << "Cutoff now: " << cutoff << endl;
                }
-               if (non_improvement > decrease) {
-                       non_improvement = 0;
-                       //cout << "No improvements, plepp" << endl;
-                       if (cutoff > lowest_cutoff)
-                               cutoff -= 1;
-                       else
-                               cutoff += 1;
+               if (scores.size() >= timeout) {
+                       int size = scores.size();
+                       int first = size * 1 / 2;
+                       int last = size * 1 / 3;
+                       float firstav = accumulate(scores.begin(), scores.begin() + first, 0.0) / first;
+                       float lastav = accumulate(scores.end() - last, scores.end(), 0.0) / last;
+                       if (lastav < firstav) {
+                               cout << "Decreasing! " << endl;
+                               cutoff *= 0.98;
+                       } else {
+                               cout << "NOPE " << endl;
+                       }
+                       scores.clear();
                }
                }
+               //if (non_improvement > decrease) {
+               //      non_improvement = 0;
+               //      //cout << "No improvements, plepp" << endl;
+               //      if (cutoff > lowest_cutoff)
+               //              cutoff *= 0.99;
+               //}
                if (num >= last && shutdown) {
                        cout << "==== " << endl << best_score - subtractor << endl;
                        return 0;
                if (num >= last && shutdown) {
                        cout << "==== " << endl << best_score - subtractor << endl;
                        return 0;
diff --git a/hexazero/Untitled.ipynb b/hexazero/Untitled.ipynb
new file mode 100644 (file)
index 0000000..3d8b8da
--- /dev/null
@@ -0,0 +1,741 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 119,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import tensorflow as tf\n",
+    "import numpy as np\n",
+    "import random\n",
+    "import matplotlib.pyplot as plt"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "tf.enable_eager_execution()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "hello, [[4.]]\n"
+     ]
+    }
+   ],
+   "source": [
+    "x = [[2.]]\n",
+    "m = tf.matmul(x, x)\n",
+    "print(\"hello, {}\".format(m))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[[0. 0. 1. 1. 1.]\n",
+      " [0. 1. 1. 1. 1.]\n",
+      " [1. 1. 1. 1. 1.]\n",
+      " [1. 1. 1. 1. 0.]\n",
+      " [1. 1. 1. 0. 0.]]\n"
+     ]
+    }
+   ],
+   "source": [
+    "def get_hexagon(n):\n",
+    "    height = n * 2 - 1\n",
+    "    width = height\n",
+    "    num_in_line = n\n",
+    "    num_before = n - 1\n",
+    "    hexagon = np.zeros((height, width))\n",
+    "    mask = np.zeros((height, width))\n",
+    "    row = 0\n",
+    "    col = 0\n",
+    "    for row in range(height):\n",
+    "        for col in range(width):\n",
+    "            if col < num_before:\n",
+    "                mask[row, col] = 0\n",
+    "                hexagon[row, col] = 0\n",
+    "            elif col >= num_before and col < num_before + num_in_line:\n",
+    "                mask[row, col] = 1\n",
+    "                hexagon[row, col] = 1\n",
+    "            else:\n",
+    "                mask[row, col] = 0\n",
+    "                hexagon[row, col] = 0\n",
+    "        if row < n - 1:\n",
+    "            num_before -= 1\n",
+    "            num_in_line += 1\n",
+    "        else:\n",
+    "            num_before = 0\n",
+    "            num_in_line -= 1\n",
+    "    return hexagon, mask\n",
+    "hexagon, mask = get_hexagon(3)\n",
+    "print(hexagon)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[(1, 2), (0, 2), (2, 0), (2, 1)]\n"
+     ]
+    }
+   ],
+   "source": [
+    "def is_inside(n, row, col, mask):\n",
+    "    if row < 0 or col < 0:\n",
+    "        return False\n",
+    "    if row >= n * 2 - 1 or col >= n * 2 - 1:\n",
+    "        return False\n",
+    "    if mask[row, col] == 0:\n",
+    "        return False\n",
+    "    return True\n",
+    "\n",
+    "def calc_neighbours(n, row, col, mask):\n",
+    "    height = n * 2 - 1\n",
+    "    width = height\n",
+    "    idxs = []\n",
+    "    idxs.append((row, col-1))\n",
+    "    idxs.append((row, col+1))\n",
+    "    idxs.append((row-1, col))\n",
+    "    idxs.append((row-1, col+1))\n",
+    "    idxs.append((row+1, col-1))\n",
+    "    idxs.append((row+1, col))\n",
+    "    idxs = list(filter(lambda t: is_inside(n, t[0], t[1], mask), idxs))\n",
+    "    return idxs\n",
+    "\n",
+    "print(calc_neighbours(3, 1, 1, mask))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "True\n",
+      "False\n"
+     ]
+    }
+   ],
+   "source": [
+    "def is_legal_pos(n, row, col, hexagon, mask):\n",
+    "    neighbours = calc_neighbours(n, row, col, mask)\n",
+    "    v_neighbours = set([hexagon[row, col] for row, col in neighbours])\n",
+    "    v_this = hexagon[row, col]\n",
+    "    for v in range(1, int(v_this)):\n",
+    "        if v not in v_neighbours:\n",
+    "            return False\n",
+    "    return True\n",
+    "\n",
+    "def is_legal(n, hexagon, mask):\n",
+    "    for row in range(len(hexagon)):\n",
+    "        for col in range(len(hexagon[row])):\n",
+    "            if mask[row, col] != 0:\n",
+    "                if not is_legal_pos(n, row, col, hexagon, mask):\n",
+    "                    return False\n",
+    "    return True\n",
+    "\n",
+    "print(is_legal(n, hexagon, mask))\n",
+    "hexagon[2, 2] = 7\n",
+    "print(is_legal(n, hexagon, mask))\n",
+    "hexagon[2, 2] = 1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 145,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[[0. 0. 4. 2. 1.]\n",
+      " [0. 3. 1. 3. 5.]\n",
+      " [2. 1. 5. 4. 2.]\n",
+      " [4. 1. 2. 1. 0.]\n",
+      " [3. 2. 3. 0. 0.]]\n",
+      "True\n",
+      "tf.Tensor(49.0, shape=(), dtype=float64)\n",
+      "[[0. 0. 1. 2. 3.]\n",
+      " [0. 3. 2. 1. 5.]\n",
+      " [1. 4. 5. 4. 2.]\n",
+      " [3. 1. 3. 1. 0.]\n",
+      " [3. 3. 1. 0. 0.]]\n",
+      "False\n",
+      "tf.Tensor(48.0, shape=(), dtype=float64)\n"
+     ]
+    }
+   ],
+   "source": [
+    "def get_indices(mask):\n",
+    "    idxs = []\n",
+    "    for row in range(len(mask)):\n",
+    "        for col in range(len(mask[row])):\n",
+    "            if mask[row, col] != 0:\n",
+    "                idxs.append((row, col))\n",
+    "    return idxs\n",
+    "\n",
+    "def get_score(hexagon):\n",
+    "    return tf.math.reduce_sum(hexagon)\n",
+    "\n",
+    "def create_legal_hexagon(n):\n",
+    "    hexagon, mask = get_hexagon(n)\n",
+    "    idxs = get_indices(mask)\n",
+    "    for i in range(10):\n",
+    "        random.shuffle(idxs)\n",
+    "        for row, col in idxs:\n",
+    "            add = 1\n",
+    "            if hexagon[row, col] > 1 and random.randint(0, 100) < 2:\n",
+    "                add = -1\n",
+    "            hexagon[row, col] += add\n",
+    "            if not is_legal(n, hexagon, mask):\n",
+    "                hexagon[row, col] -= add\n",
+    "    return hexagon, mask\n",
+    "\n",
+    "def create_random_hexagon(n):\n",
+    "    hexagon, mask = create_legal_hexagon(n)\n",
+    "    idxs = get_indices(mask)\n",
+    "    random.shuffle(idxs)\n",
+    "    for row, col in idxs[:3]:\n",
+    "        if random.randint(0, 10) > 5:\n",
+    "            hexagon[row, col] += 1\n",
+    "        else:\n",
+    "            hexagon[row, col] -= 1\n",
+    "    return hexagon, mask\n",
+    "\n",
+    "hexagon, mask = create_legal_hexagon(3)\n",
+    "print(hexagon)\n",
+    "print(is_legal(n, hexagon, mask))\n",
+    "print(get_score(hexagon))\n",
+    "hexagon, mask = create_random_hexagon(3)\n",
+    "print(hexagon)\n",
+    "print(is_legal(n, hexagon, mask))\n",
+    "print(get_score(hexagon))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 146,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "(5, 5)\n",
+      "(5, 5)\n"
+     ]
+    },
+    {
+     "data": {
+      "text/plain": [
+       "array([[[0., 0.],\n",
+       "        [0., 0.],\n",
+       "        [1., 1.],\n",
+       "        [2., 1.],\n",
+       "        [3., 1.]],\n",
+       "\n",
+       "       [[0., 0.],\n",
+       "        [3., 1.],\n",
+       "        [2., 1.],\n",
+       "        [1., 1.],\n",
+       "        [5., 1.]],\n",
+       "\n",
+       "       [[1., 1.],\n",
+       "        [4., 1.],\n",
+       "        [5., 1.],\n",
+       "        [4., 1.],\n",
+       "        [2., 1.]],\n",
+       "\n",
+       "       [[3., 1.],\n",
+       "        [1., 1.],\n",
+       "        [3., 1.],\n",
+       "        [1., 1.],\n",
+       "        [0., 0.]],\n",
+       "\n",
+       "       [[3., 1.],\n",
+       "        [3., 1.],\n",
+       "        [1., 1.],\n",
+       "        [0., 0.],\n",
+       "        [0., 0.]]])"
+      ]
+     },
+     "execution_count": 146,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "print(hexagon.shape)\n",
+    "print(mask.shape)\n",
+    "np.dstack([hexagon, mask])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 290,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1000\n",
+      "2000\n",
+      "3000\n",
+      "4000\n",
+      "5000\n",
+      "6000\n",
+      "7000\n",
+      "8000\n",
+      "9000\n",
+      "10000\n",
+      "11000\n",
+      "12000\n",
+      "13000\n",
+      "14000\n",
+      "15000\n",
+      "16000\n",
+      "17000\n",
+      "18000\n",
+      "19000\n"
+     ]
+    }
+   ],
+   "source": [
+    "n = 4\n",
+    "dataset = []\n",
+    "for i in range(10000):\n",
+    "    if len(dataset) % 1000 == 0:\n",
+    "        print(len(dataset))\n",
+    "    hexagon, mask = create_legal_hexagon(n)\n",
+    "    dataset.append((np.dstack([hexagon, mask]), 1))\n",
+    "while len(dataset) < 20000:\n",
+    "    if len(dataset) % 1000 == 0:\n",
+    "        print(len(dataset))\n",
+    "    hexagon, mask = create_random_hexagon(n)\n",
+    "    if is_legal(n, hexagon, mask):\n",
+    "        continue\n",
+    "    dataset.append((np.dstack([hexagon, mask]), 0))\n",
+    "random.shuffle(dataset)\n",
+    "num = len(dataset)\n",
+    "num_train = int(num * 2 / 3)\n",
+    "train = dataset[:num_train]\n",
+    "test = dataset[num_train:]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 350,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "regularizer = tf.keras.regularizers.l2(0.01)\n",
+    "\n",
+    "def residual_conv(features, size, x):\n",
+    "    y = tf.keras.layers.Conv2D(features, size,\n",
+    "                               activation='relu', padding=\"same\",\n",
+    "                               kernel_regularizer=regularizer)(x)\n",
+    "    z = tf.keras.layers.add([x, y])\n",
+    "    return z\n",
+    "\n",
+    "input_layer = tf.keras.layers.Input(shape=(n*2-1, n*2-1, 2))\n",
+    "x = tf.keras.layers.Conv2D(32, [1, 1], activation='relu', padding=\"same\",\n",
+    "                           kernel_regularizer=regularizer)(input_layer)\n",
+    "x = residual_conv(32, [3, 3], x)\n",
+    "x = residual_conv(32, [3, 3], x)\n",
+    "x = residual_conv(32, [3, 3], x)\n",
+    "x = residual_conv(32, [3, 3], x)\n",
+    "p = tf.keras.layers.GlobalMaxPooling2D()(x)\n",
+    "p = tf.keras.layers.Dense(32, kernel_regularizer=regularizer)(p)\n",
+    "p = tf.keras.layers.Dense(16, kernel_regularizer=regularizer)(p)\n",
+    "p = tf.keras.layers.Dense(16, kernel_regularizer=regularizer)(p)\n",
+    "p = tf.keras.layers.Dense(8, kernel_regularizer=regularizer)(p)\n",
+    "p = tf.keras.layers.Dense(2, kernel_regularizer=regularizer)(p)\n",
+    "\n",
+    "model = tf.keras.models.Model(input_layer, p)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 351,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "(1, 7, 7, 2)\n",
+      "tf.Tensor([[-2.4667258 -3.692261 ]], shape=(1, 2), dtype=float32)\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(batch.shape)\n",
+    "print(model(batch))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 352,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def group_list(l, group_size):\n",
+    "    for i in range(0, len(l), group_size):\n",
+    "        yield l[i:i+group_size]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 353,
+   "metadata": {
+    "scrolled": true
+   },
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0.36\n",
+      "0.58\n",
+      "0.58\n",
+      "0.49\n",
+      "0.49\n",
+      "0.56\n",
+      "0.56\n",
+      "0.59\n",
+      "0.64\n",
+      "0.78\n",
+      "0.8\n",
+      "REDUCING THE LEARNING RATE\n",
+      "0.58\n",
+      "0.79\n",
+      "0.77\n",
+      "0.77\n",
+      "0.77\n",
+      "0.78\n",
+      "0.79\n",
+      "0.86\n",
+      "0.85\n",
+      "0.86\n",
+      "0.88\n",
+      "0.82\n",
+      "0.79\n",
+      "0.81\n",
+      "0.82\n",
+      "0.84\n",
+      "0.83\n",
+      "0.85\n",
+      "0.87\n",
+      "0.85\n",
+      "0.82\n",
+      "0.78\n",
+      "0.81\n",
+      "0.77\n",
+      "0.82\n",
+      "0.85\n",
+      "0.9\n",
+      "0.89\n",
+      "0.93\n",
+      "0.86\n",
+      "0.89\n",
+      "0.87\n",
+      "0.88\n",
+      "0.87\n",
+      "0.9\n",
+      "0.9\n",
+      "0.87\n",
+      "0.88\n",
+      "0.89\n",
+      "0.9\n",
+      "0.92\n",
+      "0.9\n",
+      "0.91\n",
+      "0.92\n",
+      "0.9\n",
+      "0.9\n",
+      "0.89\n",
+      "0.89\n",
+      "0.9\n",
+      "0.89\n",
+      "REDUCING THE LEARNING RATE\n",
+      "0.9\n",
+      "0.89\n",
+      "0.88\n",
+      "0.88\n",
+      "0.89\n",
+      "0.89\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.9\n",
+      "0.9\n",
+      "0.9\n",
+      "0.89\n",
+      "0.89\n",
+      "0.91\n",
+      "0.87\n",
+      "0.87\n",
+      "0.87\n",
+      "0.88\n",
+      "0.87\n",
+      "0.89\n",
+      "0.89\n",
+      "0.9\n",
+      "0.9\n",
+      "0.89\n",
+      "0.88\n",
+      "0.85\n",
+      "0.9\n",
+      "0.87\n",
+      "0.88\n",
+      "0.88\n",
+      "0.89\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.88\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n",
+      "0.89\n"
+     ]
+    }
+   ],
+   "source": [
+    "print(get_accuracy(test[0:100]))\n",
+    "loss_history = []\n",
+    "def train_some(epochs, learning_rate):\n",
+    "    optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate)\n",
+    "    for epoch in range(epochs):\n",
+    "        for group in group_list(train, 64):\n",
+    "            hexagons, labels = zip(*group)\n",
+    "            with tf.GradientTape() as tape:\n",
+    "                batch = np.array(hexagons, dtype=np.float32)\n",
+    "                logits = model(batch, training=True)\n",
+    "                loss_value = tf.losses.sparse_softmax_cross_entropy(labels, logits)\n",
+    "\n",
+    "            loss_history.append(loss_value.numpy())\n",
+    "            grads = tape.gradient(loss_value, model.variables)\n",
+    "            optimizer.apply_gradients(zip(grads, model.variables),\n",
+    "                                      global_step=tf.train.get_or_create_global_step())\n",
+    "        print(get_accuracy(test[0:100]))\n",
+    "train_some(10, 0.0001)\n",
+    "print(\"REDUCING THE LEARNING RATE\")\n",
+    "train_some(50, 0.001)\n",
+    "print(\"REDUCING THE LEARNING RATE\")\n",
+    "train_some(100, 0.0001)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 354,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAD8CAYAAAB6paOMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAHIlJREFUeJzt3XmUFPW99/H3d4ZhE5RlRiEIjiiRKwmCjgtu8XFFTCRGjfLck6jXXOJ2Y+7xPieghmieRKMeNQ/RyMWrQaMRF4whEVAiuLMN+yYwDLsgw75vM9/njy7GnmFmumemerqb+rzO6UN11a+rvl3T9KerfrWYuyMiItGVk+4CREQkvRQEIiIRpyAQEYk4BYGISMQpCEREIk5BICIScQoCEZGIUxCIiEScgkBEJOKapWvB+fn5XlhYmK7Fi4hkpZkzZ25y94Iw55m2ICgsLKS4uDhdixcRy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NrMW1WtOsrZ6fz6yLQgy0YXufiZwNXC3mV0cPzFI5Iw/NCtb6gSeA04B+gDrgSfTW07tzKwNMAb4ubvviJ+Wqeu7hpozfn27e7m79wFOJPYLvmeaS0qoes1m9i1gKLHazya2u+cXTVVPtgXBOqBr3PMTg3Fp4+7rgn83An8l9kH8Ktg8I/h3Y9C8tvrT9b7CqnNdMFx9fOjc/avgP1EF8Dyx9d2QmjcT28RuVm18KMwsj9gX6qvu/nYwOqPXd001Z8v6DmrdBkwG+tWxrMr6gunHBbWl5f9mXM39g91z7u77gT/R8HVd/89HXR0ImfYgdmvNUmKdOYc7bnqlsZ5jgLZxw58T27f/BFU7BR8Phq+haqfPdP+602cFsQ6f9sFwhxTUW0jVjtfQ6uTIzqkBKaq5c9zwfxLbrwvQi6qdfaXEOvpq/cwAb1K1Q/GukGo2Yvtlf19tfMau7zpqzuj1DRQA7YLhVsAnwHdrWxZwN1U7i99o6PtJQc2d4/4Wvwd+11Sfj9C/HFP9INaDvpTYfsAH0lxL9+CDMRdYeLgeYvscPwCWAf+M++MY8GxQ+3ygKG5e/0asg6oEuC0Ftb5GbNP+ILF9hreHWSdQBCwIXvMMwcmKKaj5z0FN84CxVP2ieiBY/hLijpKo7TMT/P2mB+/lTaBFSOv6QmK7feYBc4LHgExe33XUnNHrG+gNzA7qWwAMq2tZQMvgeUkwvXtD308Kap4UrOsFwCt8fWRRyj8fOrNYRCTisq2PQEREQqYgEBGJOAWBiEjEKQhERCJOQSAiEnEKAhGRiFMQiIhEnIJARCTi/j9IAlQOww+7oQAAAABJRU5ErkJggg==\n",
+      "text/plain": [
+       "<Figure size 432x288 with 1 Axes>"
+      ]
+     },
+     "metadata": {
+      "needs_background": "light"
+     },
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "plt.plot(loss_history)\n",
+    "plt.show()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 355,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Res: [[9.9999845e-01 1.5732946e-06]], label: 0\n",
+      "Res: [[8.502894e-17 1.000000e+00]], label: 0\n",
+      "Res: [[0.9206721  0.07932796]], label: 1\n",
+      "Res: [[1.0000000e+00 1.9434042e-13]], label: 0\n",
+      "Res: [[1. 0.]], label: 0\n",
+      "Res: [[1.1225089e-15 1.0000000e+00]], label: 1\n",
+      "Res: [[2.8632873e-17 1.0000000e+00]], label: 1\n",
+      "Res: [[1.0000000e+00 1.0961664e-09]], label: 0\n",
+      "Res: [[2.8555167e-20 1.0000000e+00]], label: 1\n",
+      "Res: [[1. 0.]], label: 0\n",
+      "Res: [[1.000000e+00 1.352525e-19]], label: 0\n",
+      "Res: [[5.228935e-33 1.000000e+00]], label: 1\n",
+      "Res: [[1. 0.]], label: 0\n",
+      "Res: [[5.02569e-23 1.00000e+00]], label: 1\n",
+      "Res: [[1.6025894e-11 1.0000000e+00]], label: 1\n",
+      "Res: [[1.000000e+00 9.664101e-21]], label: 0\n",
+      "Res: [[1.3769099e-33 1.0000000e+00]], label: 0\n",
+      "Res: [[5.9467072e-21 1.0000000e+00]], label: 1\n",
+      "Res: [[0.00465067 0.99534935]], label: 1\n",
+      "Res: [[2.0852122e-08 1.0000000e+00]], label: 1\n"
+     ]
+    }
+   ],
+   "source": [
+    "for hexagon, label in test[0:20]:\n",
+    "    batch = np.array(np.expand_dims(hexagon, axis=0), dtype=np.float32)\n",
+    "    print(\"Res: {}, label: {}\".format(tf.nn.softmax(model(batch)), label))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 356,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0.8813559322033898\n"
+     ]
+    }
+   ],
+   "source": [
+    "def get_accuracy(test):\n",
+    "    correct = 0\n",
+    "    total = 0\n",
+    "    for hexagon, label in test:\n",
+    "        batch = np.array(np.expand_dims(hexagon, axis=0), dtype=np.float32)\n",
+    "        pred = tf.argmax(model(batch)[0])\n",
+    "        correct += int(pred) == label\n",
+    "        total += 1\n",
+    "    return correct / total\n",
+    "print(get_accuracy(test))"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "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.6.7"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}