lczerolens
🔬 Interpretability for Leela Chess Zero networks.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Keywords
Repository
🔬 Interpretability for Leela Chess Zero networks.
Basic Info
- Host: GitHub
- Owner: Xmaster6y
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://lczerolens.readthedocs.io
- Size: 1.66 MB
Statistics
- Stars: 15
- Watchers: 5
- Forks: 3
- Open Issues: 10
- Releases: 10
Topics
Metadata Files
README.md
lczerolens 🔍
Leela Chess Zero (lc0) Lens (lczerolens): a set of utilities to make interpretability easy and framework-agnostic (PyTorch): use it with tdhook, captum, zennit, or nnsight.
Getting Started
Installs
bash
pip install lczerolens
Take the viz extra to render heatmaps and the backends extra to use the lc0 backends.
Run Models
Get the best move predicted by a model:
```python from lczerolens import LczeroBoard, LczeroModel
model = LczeroModel.from_hf("lczerolens/maia-1100") board = LczeroBoard()
output = model(board) bestmoveidx = output["policy"].argmax() print(board.decodemove(bestmove_idx)) ```
Framework-Agnostic Interpretability
Use lczerolens with your preferred PyTorch interpretability framework (tdhook, captum, zennit, nnsight). More examples in the framework-agnostic interpretability notebook.
```python from lczerolens import LczeroBoard, LczeroModel model = LczeroModel.from_hf("lczerolens/maia-1100") board = LczeroBoard()
TODO: complete this example
```
Features
- Encode Boards:
- Load Models:
- Move Prediction:
- Run Models on GPU:
- Evaluate Models on Puzzles:
- Convert Official Weights:
- Visualise Heatmaps:
- Probe Concepts:
Tutorials
- Walkthrough:
- Framework-Agnostic Interpretability:
- More to come...
Demo
Spaces
Some Hugging Face Spaces are available to try out the library. The demo (:red_circle: in construction) will showcase some of the features of the library and the backends demo makes the conversion of lc0 models to onnx easy.
Local Demo
Additionally, you can run the gradio demos locally. First you'll need to clone the spaces (after cloning the repo):
bash
git clone https://huggingface.co/spaces/lczerolens/demo spaces/demo
And optionally the backends demo:
bash
git clone https://huggingface.co/spaces/lczerolens/backends-demo spaces/backends-demo
And then launch the demo (running on port 8000):
bash
just demo
To test the backends use:
bash
just demo-backends
Full Documentation
See the full documentation.
Contribute
See the guidelines in CONTRIBUTING.md.
Owner
- Name: Yoann Poupart
- Login: Xmaster6y
- Kind: user
- Location: Lyon
- Company: ENS de Lyon
- Website: https://perso.ens-lyon.fr/yoann.poupart/
- Repositories: 3
- Profile: https://github.com/Xmaster6y
:computer: Self-taught and tech-savvy student.
Citation (CITATION.cff)
cff-version: 1.2.0 title: LCZeroLens version: 0.1.0 date-released: 2024-02-09 type: software authors: - name: Yoann Poupart repository-code: 'https://github.com/Xmaster6y/lczerolens' repository-artifact: 'https://github.com/Xmaster6y/lczerolens/releases/' keywords: - chess - explainable AI (XAI) license: MIT
GitHub Events
Total
- Create event: 46
- Release event: 6
- Issues event: 39
- Watch event: 9
- Delete event: 43
- Issue comment event: 60
- Push event: 161
- Pull request review event: 59
- Pull request review comment event: 90
- Pull request event: 79
- Fork event: 1
Last Year
- Create event: 46
- Release event: 6
- Issues event: 39
- Watch event: 9
- Delete event: 43
- Issue comment event: 60
- Push event: 161
- Pull request review event: 59
- Pull request review comment event: 90
- Pull request event: 79
- Fork event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 33
- Total pull requests: 65
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.18
- Average comments per pull request: 0.94
- Merged pull requests: 53
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 22
- Pull requests: 40
- Average time to close issues: 4 days
- Average time to close pull requests: about 5 hours
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.27
- Average comments per pull request: 1.25
- Merged pull requests: 33
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Xmaster6y (33)
Pull Request Authors
- Xmaster6y (62)
- NOVAdrien (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 406 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 8
- Total maintainers: 1
pypi.org: lczerolens
Interpretability for LeelaChessZero networks.
- Documentation: https://lczerolens.readthedocs.io/
- License: mit
-
Latest release: 0.3.3
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- python 3.9.18 build
- 125 dependencies