Upload reference/net.rs with huggingface_hub
Browse files- reference/net.rs +11 -2
reference/net.rs
CHANGED
|
@@ -15,7 +15,16 @@
|
|
| 15 |
//! Alongside the 768 piece-square planes sit 166 rows encoding mobility,
|
| 16 |
//! passed pawns, pawn structure, rook files, the bishop pair, king attackers
|
| 17 |
//! and king shelter — computed from the board and looked up in the same
|
| 18 |
-
//! embedding table. Each row costs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
//!
|
| 20 |
//! This file is the single source of truth for feature extraction. The trainer
|
| 21 |
//! never re-implements it; it asks the engine for indices through `featdump`.
|
|
@@ -31,7 +40,7 @@ const BLOB: &[u8] = include_bytes!("../net.bin");
|
|
| 31 |
const MAGIC: usize = 0x334C_4253; // "SBL3" little-endian
|
| 32 |
|
| 33 |
/// Hidden neurons per perspective.
|
| 34 |
-
pub const H: usize =
|
| 35 |
/// Output-layer sets, indexed by remaining material.
|
| 36 |
pub const BUCKETS: usize = 8;
|
| 37 |
|
|
|
|
| 15 |
//! Alongside the 768 piece-square planes sit 166 rows encoding mobility,
|
| 16 |
//! passed pawns, pawn structure, rook files, the bishop pair, king attackers
|
| 17 |
//! and king shelter — computed from the board and looked up in the same
|
| 18 |
+
//! embedding table. Each row costs 64 bytes. The whole network is 60,976.
|
| 19 |
+
//!
|
| 20 |
+
//! Width is worth something after all, and the paragraph above is the reason it
|
| 21 |
+
//! looked like it wasn't. Every width comparison here was run before the
|
| 22 |
+
//! trainer had an output gain, so a wider network was measured against a
|
| 23 |
+
//! differently-*scaled* one rather than a narrower one. With that constant held
|
| 24 |
+
//! fixed, 64 neurons beat 32 by about 16 Elo over 2000 games and 128 beat 64 by
|
| 25 |
+
//! nothing at all — and 128 also spills the accumulator out of the register
|
| 26 |
+
//! file. The plateau is real; it just starts one doubling later than the
|
| 27 |
+
//! original sweep said.
|
| 28 |
//!
|
| 29 |
//! This file is the single source of truth for feature extraction. The trainer
|
| 30 |
//! never re-implements it; it asks the engine for indices through `featdump`.
|
|
|
|
| 40 |
const MAGIC: usize = 0x334C_4253; // "SBL3" little-endian
|
| 41 |
|
| 42 |
/// Hidden neurons per perspective.
|
| 43 |
+
pub const H: usize = 64;
|
| 44 |
/// Output-layer sets, indexed by remaining material.
|
| 45 |
pub const BUCKETS: usize = 8;
|
| 46 |
|