Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 16 new columns ({'Turnos_Totales', 'Tiempo_Calc_Blancas', 'Color_Blancas', 'Resultado_Texto', 'Color_Negras', 'Agente_Negras', 'Nodos_Negras', 'Ganador_Color', 'Fichas_Negras', 'Diferencial_Negras', 'Tiempo_Calc_Negras', 'ID_Cruce', 'Agente_Blancas', 'Nodos_Blancas', 'Fichas_Blancas', 'Tiempo_Total_Segundos'}) and 7 missing columns ({'Blancas', 'Fichas_N', 'Fichas_B', 'Negras', 'Dif_N', 'Ganador', 'Tiempo_Seg'}).

This happened while the csv dataset builder was generating data using

hf://datasets/varokhian/tfg-alo/datos/benchmark_othello_estadistico.csv (at revision 009e06abbaece2976131b5994be5a3fc2e9163bc), ['hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/benchmark_global_4x4_resultados.csv', 'hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/benchmark_global_8x8_resultados.csv', 'hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/benchmark_othello_estadistico.csv', 'hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/dataset_othello_8x8_6_horas.csv']

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1848, in _prepare_split_single
                  writer.write_table(table)
                  ~~~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 784, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 795, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2306, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              ID_Partida: int64
              ID_Cruce: int64
              Agente_Negras: string
              Agente_Blancas: string
              Color_Negras: string
              Color_Blancas: string
              Fichas_Negras: int64
              Fichas_Blancas: int64
              Diferencial_Negras: int64
              Ganador_Color: string
              Resultado_Texto: string
              Tiempo_Total_Segundos: double
              Turnos_Totales: int64
              Nodos_Negras: int64
              Nodos_Blancas: int64
              Tiempo_Calc_Negras: double
              Tiempo_Calc_Blancas: double
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 2438
              to
              {'ID_Partida': Value('int64'), 'Negras': Value('string'), 'Blancas': Value('string'), 'Fichas_N': Value('int64'), 'Fichas_B': Value('int64'), 'Dif_N': Value('int64'), 'Ganador': Value('string'), 'Tiempo_Seg': Value('float64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1850, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
                  ...<4 lines>...
                  )
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 16 new columns ({'Turnos_Totales', 'Tiempo_Calc_Blancas', 'Color_Blancas', 'Resultado_Texto', 'Color_Negras', 'Agente_Negras', 'Nodos_Negras', 'Ganador_Color', 'Fichas_Negras', 'Diferencial_Negras', 'Tiempo_Calc_Negras', 'ID_Cruce', 'Agente_Blancas', 'Nodos_Blancas', 'Fichas_Blancas', 'Tiempo_Total_Segundos'}) and 7 missing columns ({'Blancas', 'Fichas_N', 'Fichas_B', 'Negras', 'Dif_N', 'Ganador', 'Tiempo_Seg'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/varokhian/tfg-alo/datos/benchmark_othello_estadistico.csv (at revision 009e06abbaece2976131b5994be5a3fc2e9163bc), ['hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/benchmark_global_4x4_resultados.csv', 'hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/benchmark_global_8x8_resultados.csv', 'hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/benchmark_othello_estadistico.csv', 'hf://datasets/varokhian/tfg-alo@009e06abbaece2976131b5994be5a3fc2e9163bc/datos/dataset_othello_8x8_6_horas.csv']
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

ID_Partida
int64
Negras
string
Blancas
string
Fichas_N
int64
Fichas_B
int64
Dif_N
int64
Ganador
string
Tiempo_Seg
float64
1
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.122507
2
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.186473
3
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.146214
4
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.141158
5
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.137181
6
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.115115
7
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.148123
8
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.099017
9
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.117565
10
Minimax_Universal
AlfaBeta_Pesos_d4
2
11
-9
B
8.079067
11
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.053653
12
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.061839
13
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.054333
14
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.073045
15
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.064513
16
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.06917
17
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.062704
18
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.048815
19
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.046888
20
AlfaBeta_Pesos_d4
Minimax_Universal
7
9
-2
B
2.050014
21
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.625642
22
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.585216
23
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.589438
24
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.618827
25
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.584824
26
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.574333
27
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.569128
28
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.658373
29
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.60315
30
Minimax_Universal
Agente_Tabula_Rasa_PUCT
9
7
2
N
8.685053
31
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.377026
32
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.416428
33
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.459926
34
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.411197
35
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.391615
36
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.393806
37
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.392607
38
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.380875
39
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.375761
40
Agente_Tabula_Rasa_PUCT
Minimax_Universal
1
14
-13
B
2.377539
41
Minimax_Universal
Random
9
7
2
N
8.145641
42
Minimax_Universal
Random
15
1
14
N
8.374537
43
Minimax_Universal
Random
9
7
2
N
8.304246
44
Minimax_Universal
Random
9
7
2
N
8.095337
45
Minimax_Universal
Random
11
1
10
N
8.379104
46
Minimax_Universal
Random
9
7
2
N
8.300909
47
Minimax_Universal
Random
9
7
2
N
8.370859
48
Minimax_Universal
Random
9
7
2
N
8.088892
49
Minimax_Universal
Random
11
1
10
N
8.365459
50
Minimax_Universal
Random
9
7
2
N
8.175973
51
Random
Minimax_Universal
0
16
-16
B
2.038494
52
Random
Minimax_Universal
1
14
-13
B
2.118803
53
Random
Minimax_Universal
7
9
-2
B
2.057458
54
Random
Minimax_Universal
1
15
-14
B
2.053519
55
Random
Minimax_Universal
7
9
-2
B
2.052892
56
Random
Minimax_Universal
5
11
-6
B
2.094203
57
Random
Minimax_Universal
7
9
-2
B
2.02691
58
Random
Minimax_Universal
7
9
-2
B
2.048471
59
Random
Minimax_Universal
4
12
-8
B
2.100709
60
Random
Minimax_Universal
1
15
-14
B
2.030884
61
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.117806
62
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.117514
63
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.117177
64
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.117181
65
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.110514
66
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.115546
67
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.117447
68
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.118361
69
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.117532
70
AlfaBeta_Pesos_d4
Agente_Tabula_Rasa_PUCT
9
1
8
N
0.119731
71
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.201962
72
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.200521
73
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.21657
74
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.20637
75
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.207576
76
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.205733
77
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.200413
78
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.202788
79
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.20773
80
Agente_Tabula_Rasa_PUCT
AlfaBeta_Pesos_d4
1
14
-13
B
0.200179
81
AlfaBeta_Pesos_d4
Random
5
11
-6
B
0.02108
82
AlfaBeta_Pesos_d4
Random
10
6
4
N
0.017625
83
AlfaBeta_Pesos_d4
Random
1
15
-14
B
0.019145
84
AlfaBeta_Pesos_d4
Random
5
11
-6
B
0.020746
85
AlfaBeta_Pesos_d4
Random
10
6
4
N
0.022024
86
AlfaBeta_Pesos_d4
Random
8
8
0
E
0.018104
87
AlfaBeta_Pesos_d4
Random
9
7
2
N
0.019246
88
AlfaBeta_Pesos_d4
Random
10
6
4
N
0.017729
89
AlfaBeta_Pesos_d4
Random
14
0
14
N
0.01818
90
AlfaBeta_Pesos_d4
Random
4
12
-8
B
0.01569
91
Random
AlfaBeta_Pesos_d4
1
10
-9
B
0.009691
92
Random
AlfaBeta_Pesos_d4
1
10
-9
B
0.009986
93
Random
AlfaBeta_Pesos_d4
1
10
-9
B
0.010977
94
Random
AlfaBeta_Pesos_d4
2
11
-9
B
0.011048
95
Random
AlfaBeta_Pesos_d4
4
12
-8
B
0.014186
96
Random
AlfaBeta_Pesos_d4
1
15
-14
B
0.01252
97
Random
AlfaBeta_Pesos_d4
5
11
-6
B
0.012663
98
Random
AlfaBeta_Pesos_d4
1
10
-9
B
0.009508
99
Random
AlfaBeta_Pesos_d4
1
10
-9
B
0.011441
100
Random
AlfaBeta_Pesos_d4
10
6
4
N
0.014095
End of preview.

Othello Game Theory & AlphaZero Datasets and Pretrained Models

Trabajo de Fin de Grado en Matemáticas
Autor: Álvaro León Ojeda
Repositorio GitHub: tfg-alo (varokhian)


📌 Resumen del Conjunto de Datos y Modelos

Este repositorio de Hugging Face alberga los conjuntos de datos experimentales y los checkpoints de redes neuronales desarrollados en el marco del Trabajo de Fin de Grado (TFG) en Matemáticas: Introducción a la Inteligencia Artificial: Búsqueda con adversario.

Contiene:

  1. dataset_othello_8x8_6_horas.csv: Conjunto de datos masivo generado mediante 6 horas continuas de auto-juego (Self-Play) entre motores Minimax heurísticos ($\alpha$-$\beta$ con política $\epsilon$-greedy y aperturas aleatorias) en Othello $8 \times 8$. Contiene más de 22.000 estados de juego etiquetados con el resultado final.
  2. benchmark_othello_estadistico.csv: Registro exhaustivo partida a partida de las 280 partidas del torneo experimental clásico del Capítulo 5 (8 agentes, 28 cruces, 10 partidas por cruce con alternancia de color).
  3. benchmark_global_8x8_resultados.csv y benchmark_global_4x4_resultados.csv: Resultados de los torneos multiramas del Capítulo 6 comparando MCTS Neuronal frente a Minimax y agentes Tabula Rasa.
  4. mejor_red_valor_8x8.pth: Pesos de la Red Convolucional de Valor (RedDeValorCNN, 2.3 MB) entrenada bajo marco canónico con PyTorch y optimizador AdamW, alcanzando el mínimo error cuadrático medio (MSE) de validación.
  5. tabula_rasa_4x4.pth: Pesos de la red dual (política y valor, 95 KB) entrenada sin conocimiento humano previo mediante refuerzo Tabula Rasa en Othello $4 \times 4$.

📐 Estructura de Datos y Enmarcado Canónico

Cada fila del conjunto de datos dataset_othello_8x8_6_horas.csv representa una tupla $(\mathbf{s}, a, z)$ con la siguiente estructura de columnas:

Columna Tipo Descripción
ID_Partida int Identificador único secuencial de la partida.
Numero_Turno int Turno de la partida en el que se produjo el estado.
Turno_Actual str Pieza a la que le corresponde jugar ('N' para Negras, 'B' para Blancas).
Algoritmo str Identificador del motor que tomó la decisión (ej. `alfa_beta_pesos
Tablero str Cadena lineal de 64 caracteres (' ', 'N', 'B') representando el estado matricial $8 \times 8$.
Ganador_Final float Resultado terminal de la partida ($\pm 1.0$ o $0.0$).

Representación Canónica en PyTorch (2 Canales Espaciales)

Para garantizar la invariancia del modelo respecto al color de las piezas asignado en cada partida, cada estado de 64 casillas se transforma en un tensor de PyTorch de dimensión $(2, 8, 8)$ tipo torch.float32:

  • Canal 0 ($8 \times 8$): Matriz binaria indicando las casillas ocupadas por el jugador activo (Turno_Actual).
  • Canal 1 ($8 \times 8$): Matriz binaria indicando las casillas ocupadas por el rival.
  • Alineación del Objetivo ($z$): $$z = \begin{cases} +1.0 & \text{si el jugador activo del Canal 0 gana la partida} \ -1.0 & \text{si el jugador activo del Canal 0 pierde la partida} \ 0.0 & \text{en caso de tablas / empate} \end{cases}$$

🧠 Arquitectura de la Red de Valor (RedDeValorCNN)

La red implementada en PyTorch procesa tensores de entrada $(B, 2, 8, 8)$:

  1. Conv2D(in=2, out=32, kernel=3, pad=1) + BatchNorm2d + ReLU
  2. Conv2D(in=32, out=64, kernel=3, pad=1) + BatchNorm2d + ReLU
  3. Conv2D(in=64, out=64, kernel=3, pad=1) + BatchNorm2d + ReLU
  4. Flatten $\to$ Linear(64 * 8 * 8, 128) + ReLU + Dropout(p=0.3)
  5. Linear(128, 1) + Tanh $\implies v(\mathbf{s}) \in [-1.0, 1.0]$

💻 Ejemplo Rápido de Uso en Python

import torch
import pandas as pd
from cargar_dataset_hf import cargar_modelo_8x8, estado_a_tensor

# 1. Cargar el modelo pre-entrenado
dispositivo = "cuda" if torch.cuda.is_available() else "cpu"
modelo = cargar_modelo_8x8("modelos/mejor_red_valor_8x8.pth", dispositivo=dispositivo)

# 2. Cargar un ejemplo del dataset
df = pd.read_csv("datos/dataset_othello_8x8_6_horas.csv")
ejemplo = df.iloc[0]

# 3. Transformar tablero a tensor canónico (1, 2, 8, 8)
tensor = estado_a_tensor(ejemplo["Tablero"], ejemplo["Turno_Actual"]).to(dispositivo)

# 4. Inferencia del valor esperado
with torch.no_grad():
    valor_predicho = modelo(tensor).item()

print(f"Turno: {ejemplo['Turno_Actual']}")
print(f"Valor estimado por la CNN v(s): {valor_predicho:.4f} (Rango [-1, 1])")
print(f"Resultado real de la partida (Target z): {ejemplo['Ganador_Final']}")

Downloads last month
59