Upload ChessBot Chess model
Browse files- .gitignore +125 -0
- README.md +1 -17
.gitignore
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python cache files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
# Distribution / packaging
|
| 7 |
+
.Python
|
| 8 |
+
build/
|
| 9 |
+
develop-eggs/
|
| 10 |
+
dist/
|
| 11 |
+
downloads/
|
| 12 |
+
eggs/
|
| 13 |
+
.eggs/
|
| 14 |
+
lib/
|
| 15 |
+
lib64/
|
| 16 |
+
parts/
|
| 17 |
+
sdist/
|
| 18 |
+
var/
|
| 19 |
+
wheels/
|
| 20 |
+
*.egg-info/
|
| 21 |
+
.installed.cfg
|
| 22 |
+
*.egg
|
| 23 |
+
MANIFEST
|
| 24 |
+
|
| 25 |
+
# PyInstaller
|
| 26 |
+
*.manifest
|
| 27 |
+
*.spec
|
| 28 |
+
|
| 29 |
+
# Installer logs
|
| 30 |
+
pip-log.txt
|
| 31 |
+
pip-delete-this-directory.txt
|
| 32 |
+
|
| 33 |
+
# Unit test / coverage reports
|
| 34 |
+
htmlcov/
|
| 35 |
+
.tox/
|
| 36 |
+
.nox/
|
| 37 |
+
.coverage
|
| 38 |
+
.coverage.*
|
| 39 |
+
.cache
|
| 40 |
+
nosetests.xml
|
| 41 |
+
coverage.xml
|
| 42 |
+
*.cover
|
| 43 |
+
.hypothesis/
|
| 44 |
+
.pytest_cache/
|
| 45 |
+
|
| 46 |
+
# Translations
|
| 47 |
+
*.mo
|
| 48 |
+
*.pot
|
| 49 |
+
|
| 50 |
+
# Django stuff:
|
| 51 |
+
*.log
|
| 52 |
+
local_settings.py
|
| 53 |
+
db.sqlite3
|
| 54 |
+
|
| 55 |
+
# Flask stuff:
|
| 56 |
+
instance/
|
| 57 |
+
.webassets-cache
|
| 58 |
+
|
| 59 |
+
# Scrapy stuff:
|
| 60 |
+
.scrapy
|
| 61 |
+
|
| 62 |
+
# Sphinx documentation
|
| 63 |
+
docs/_build/
|
| 64 |
+
|
| 65 |
+
# PyBuilder
|
| 66 |
+
target/
|
| 67 |
+
|
| 68 |
+
# Jupyter Notebook
|
| 69 |
+
.ipynb_checkpoints
|
| 70 |
+
|
| 71 |
+
# IPython
|
| 72 |
+
profile_default/
|
| 73 |
+
ipython_config.py
|
| 74 |
+
|
| 75 |
+
# pyenv
|
| 76 |
+
.python-version
|
| 77 |
+
|
| 78 |
+
# celery beat schedule file
|
| 79 |
+
celerybeat-schedule
|
| 80 |
+
|
| 81 |
+
# SageMath parsed files
|
| 82 |
+
*.sage.py
|
| 83 |
+
|
| 84 |
+
# Environments
|
| 85 |
+
.env
|
| 86 |
+
.venv
|
| 87 |
+
env/
|
| 88 |
+
venv/
|
| 89 |
+
ENV/
|
| 90 |
+
env.bak/
|
| 91 |
+
venv.bak/
|
| 92 |
+
|
| 93 |
+
# Spyder project settings
|
| 94 |
+
.spyderproject
|
| 95 |
+
.spyproject
|
| 96 |
+
|
| 97 |
+
# Rope project settings
|
| 98 |
+
.ropeproject
|
| 99 |
+
|
| 100 |
+
# mkdocs documentation
|
| 101 |
+
/site
|
| 102 |
+
|
| 103 |
+
# mypy
|
| 104 |
+
.mypy_cache/
|
| 105 |
+
.dmypy.json
|
| 106 |
+
dmypy.json
|
| 107 |
+
|
| 108 |
+
# Pyre type checker
|
| 109 |
+
.pyre/
|
| 110 |
+
|
| 111 |
+
# IDE
|
| 112 |
+
.vscode/
|
| 113 |
+
.idea/
|
| 114 |
+
*.swp
|
| 115 |
+
*.swo
|
| 116 |
+
*~
|
| 117 |
+
|
| 118 |
+
# OS
|
| 119 |
+
.DS_Store
|
| 120 |
+
.DS_Store?
|
| 121 |
+
._*
|
| 122 |
+
.Spotlight-V100
|
| 123 |
+
.Trashes
|
| 124 |
+
ehthumbs.db
|
| 125 |
+
Thumbs.db
|
README.md
CHANGED
|
@@ -44,23 +44,7 @@ model = model.to(device)
|
|
| 44 |
|
| 45 |
# Get the best move
|
| 46 |
move = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)
|
| 47 |
-
print(f"
|
| 48 |
-
|
| 49 |
-
# Get the best move using value
|
| 50 |
-
value_move = model.get_best_move_value(fen, T=0, device=device)
|
| 51 |
-
print(f"Value-based move: {value_move}")
|
| 52 |
-
|
| 53 |
-
# Get position evaluation
|
| 54 |
-
position_value = model.get_position_value(fen, device=device)
|
| 55 |
-
print(f"Position value [black_win, draw, white_win]: {position_value}")
|
| 56 |
-
|
| 57 |
-
# Get move probabilities
|
| 58 |
-
probs = model.get_move_from_fen_no_thinking(fen, T=1, device=device, return_probs=True)
|
| 59 |
-
top_moves = sorted(probs.items(), key=lambda x: x[1], reverse=True)[:5]
|
| 60 |
-
print("Top 5 moves:")
|
| 61 |
-
for move, prob in top_moves:
|
| 62 |
-
print(f" {move}: {prob:.4f}")
|
| 63 |
-
|
| 64 |
```
|
| 65 |
|
| 66 |
## Requirements
|
|
|
|
| 44 |
|
| 45 |
# Get the best move
|
| 46 |
move = model.get_move_from_fen_no_thinking(fen, T=0.1, device=device)
|
| 47 |
+
print(f"Predicted move: {move}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
```
|
| 49 |
|
| 50 |
## Requirements
|