yethdev commited on
Commit
dd8fd42
·
verified ·
1 Parent(s): f134437

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. LICENSE.txt +26 -0
  2. README.md +34 -0
  3. config.json +26 -0
  4. patterns.json +210 -0
  5. weights.bin +3 -0
LICENSE.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Gabriele Cirulli
4
+ Copyright (c) 2026 Yeth (yeth.dev)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ 1. The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ 2. Credit must be given to Yeth as the original
17
+ author of the AI model, training code, and dataset in any derivative work,
18
+ publication, or distribution that uses them.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - "2048"
5
+ - reinforcement-learning
6
+ - n-tuple-network
7
+ - game-ai
8
+ language:
9
+ - en
10
+ ---
11
+
12
+ # 2048 N-Tuple Network Model
13
+
14
+ Trained using TD(0) afterstate learning with 8 six-tuple patterns and 8 symmetries.
15
+
16
+ ## Stats
17
+
18
+ - Games trained: 1,200,000
19
+ - Max tile reached: 16384
20
+ - Patterns: 8 six-tuples with 8 symmetry transforms each
21
+ - Weight table size: ~347 MB
22
+
23
+ ## Files
24
+
25
+ - `weights.bin` - raw Float32 weight tables (8 x 11390625 floats)
26
+ - `config.json` - model architecture and training metadata
27
+ - `patterns.json` - tuple pattern definitions
28
+
29
+ ## Usage
30
+
31
+ Load the binary weights into 8 Float32Arrays of size 11390625 each.
32
+ For each board state, compute the feature index for each pattern under all 8 symmetries
33
+ and sum the corresponding weight values to get the board evaluation score.
34
+ Pick the move whose afterstate has the highest (reward + evaluation).
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "n-tuple-network",
3
+ "num_patterns": 8,
4
+ "tuple_size": 6,
5
+ "num_symmetries": 8,
6
+ "num_values": 15,
7
+ "table_size": 11390625,
8
+ "board_size": 4,
9
+ "tile_encoding": "log2 (0=empty, 1=2, 2=4, ... 14=16384)",
10
+ "learning_algorithm": "TD(0) afterstate",
11
+ "games_played": 1200000,
12
+ "max_tile": 16384,
13
+ "weight_dtype": "float32",
14
+ "weight_byte_order": "little-endian",
15
+ "total_weight_bytes": 364500000,
16
+ "symmetries": [
17
+ "identity",
18
+ "flip-x",
19
+ "flip-y",
20
+ "flip-xy",
21
+ "transpose",
22
+ "transpose-flip-x",
23
+ "transpose-flip-y",
24
+ "transpose-flip-xy"
25
+ ]
26
+ }
patterns.json ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 1,
95
+ 1
96
+ ],
97
+ [
98
+ 2,
99
+ 1
100
+ ],
101
+ [
102
+ 3,
103
+ 1
104
+ ]
105
+ ],
106
+ [
107
+ [
108
+ 0,
109
+ 0
110
+ ],
111
+ [
112
+ 1,
113
+ 0
114
+ ],
115
+ [
116
+ 2,
117
+ 0
118
+ ],
119
+ [
120
+ 3,
121
+ 0
122
+ ],
123
+ [
124
+ 2,
125
+ 1
126
+ ],
127
+ [
128
+ 3,
129
+ 1
130
+ ]
131
+ ],
132
+ [
133
+ [
134
+ 0,
135
+ 0
136
+ ],
137
+ [
138
+ 1,
139
+ 0
140
+ ],
141
+ [
142
+ 2,
143
+ 0
144
+ ],
145
+ [
146
+ 1,
147
+ 1
148
+ ],
149
+ [
150
+ 2,
151
+ 1
152
+ ],
153
+ [
154
+ 3,
155
+ 1
156
+ ]
157
+ ],
158
+ [
159
+ [
160
+ 0,
161
+ 0
162
+ ],
163
+ [
164
+ 1,
165
+ 0
166
+ ],
167
+ [
168
+ 0,
169
+ 1
170
+ ],
171
+ [
172
+ 1,
173
+ 1
174
+ ],
175
+ [
176
+ 2,
177
+ 1
178
+ ],
179
+ [
180
+ 2,
181
+ 2
182
+ ]
183
+ ],
184
+ [
185
+ [
186
+ 0,
187
+ 0
188
+ ],
189
+ [
190
+ 1,
191
+ 0
192
+ ],
193
+ [
194
+ 2,
195
+ 0
196
+ ],
197
+ [
198
+ 0,
199
+ 1
200
+ ],
201
+ [
202
+ 1,
203
+ 1
204
+ ],
205
+ [
206
+ 1,
207
+ 2
208
+ ]
209
+ ]
210
+ ]
weights.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10dc981c51c646d271fdffba796557e79c7d8c892456ccf3140ec3e4b85866aa
3
+ size 364500000