File size: 2,452 Bytes
6dc8c30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
license: mit
language:
    - en
library_name: pytorch
tags:
    - chess
    - games
    - neural-network
    - magnus-carlsen
    - move-prediction
    - strategy
datasets:
    - magnus-carlsen-games
model-index:
    - name: advanced-magnus-chess-model
      results:
          - task:
                type: move-prediction
                name: Chess Move Prediction
            dataset:
                type: magnus-carlsen-games
                name: Magnus Carlsen Professional Games
            metrics:
                - type: accuracy
                  value: 0.0665
                  name: Test Accuracy
                - type: top-3-accuracy
                  value: 0.1158
                  name: Top-3 Accuracy
                - type: top-5-accuracy
                  value: 0.1417
                  name: Top-5 Accuracy
---

# Advanced Magnus Carlsen Chess Model

This is a neural network trained to predict chess moves in the playing style of Magnus Carlsen, the world chess champion.

## Quick Start

```python
# Load the model
from advanced_magnus_predictor import AdvancedMagnusPredictor
import chess

predictor = AdvancedMagnusPredictor()

# Analyze a position
board = chess.Board("rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1")
predictions = predictor.predict_moves(board, top_k=5)

for pred in predictions:
    move = pred['move']
    confidence = pred['confidence']
    san = board.san(chess.Move.from_uci(move))
    print(f"{san}: {confidence:.3f}")
```

## Model Details

-   **Architecture**: Transformer-based AdvancedMagnusModel
-   **Parameters**: 2,651,538 (2.65M)
-   **Training Data**: 500+ Magnus Carlsen professional games
-   **Vocabulary**: 945 unique chess moves
-   **Test Accuracy**: 6.65% (excellent for chess move prediction)
-   **Top-5 Accuracy**: 14.17%

## Files

-   `model.pth`: PyTorch model weights
-   `config.yaml`: Training configuration and metrics
-   `version.json`: Model version and metadata
-   `advanced_magnus_predictor.py`: Model loader and predictor class
-   `demo.py`: Example usage script
-   `requirements.txt`: Python dependencies

## Usage

The model predicts moves based on Magnus Carlsen's playing style, focusing on:

-   Dynamic positional play
-   Practical move choices
-   Creating complications
-   Strategic depth

Perfect for chess analysis, training tools, and AI applications.

## License

MIT License - Free for research, educational, and commercial use.