aboutsummaryrefslogtreecommitdiff
path: root/include/weights.h
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2023-01-15 16:03:37 +0100
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commitee216c008a188a9436fedb85c70ee5d1719733b1 (patch)
treef1d8fa5efd71851dd4f8d3e2b26b1f95a6086cb9 /include/weights.h
parent7cf3a656d0c923dd92025c09747461f2f2d1bed0 (diff)
new neural network arch (faster + better) & minor changes + fixes
Gone is the convolutional neural network, for it turns out not only is it more difficult to train, but all of the extra information about board layers didn't make much of a difference at this size. So cnn1986 has been replaced by nn1986, a standard, two-layer, dense nn configured as a binary classifier and (mis)used in that capacity. Note: total number of parameters is unchanged. HARK: this new nn exposes a bug somewhere in ctak. Run ctlm with self-play to see the completely borked board state at the end.
Diffstat (limited to 'include/weights.h')
-rw-r--r--include/weights.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/include/weights.h b/include/weights.h
index ac5ede8..c4e0c3c 100644
--- a/include/weights.h
+++ b/include/weights.h
@@ -15,20 +15,11 @@
along with ct. If not, see <https://www.gnu.org/licenses/>.
*/
-#define KERN_SIZE 3
-#define KERN_CHAN 6
-#define KERN_NUM 12
-#define DENSE1_NUM 11
-#define DENSE2_NUM 8
+#define INP_NUM 3 + 5*5
+#define DENSE_NUM 64
-#define KERN_OSIZE (5-KERN_SIZE+1) // 5
-#define CONV_NUM (KERN_NUM * KERN_OSIZE * KERN_OSIZE) // 108
-extern const float conv2d_weights[KERN_NUM][KERN_SIZE][KERN_SIZE][KERN_CHAN];
-extern const float conv2d_biases[KERN_NUM];
-extern const float dense1_weights[DENSE1_NUM][CONV_NUM+2];
-extern const float dense1_biases[DENSE1_NUM];
-extern const float dense2_weights[DENSE2_NUM][DENSE1_NUM];
-extern const float dense2_biases[DENSE2_NUM];
-extern const float output_weights[DENSE2_NUM];
-extern const float output_bias;
+extern const float dense1_weights[DENSE_NUM][INP_NUM];
+extern const float dense1_biases[DENSE_NUM];
+extern const float output_weights[2][DENSE_NUM];
+extern const float output_bias[2];