Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language: en
|
| 4 |
+
tags:
|
| 5 |
+
- nethack
|
| 6 |
+
- reinforcement-learning
|
| 7 |
+
- variational-autoencoder
|
| 8 |
+
- representation-learning
|
| 9 |
+
- multimodal
|
| 10 |
+
- world-modeling
|
| 11 |
+
pipeline_tag: feature-extraction
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# MultiModalHackVAE
|
| 15 |
+
|
| 16 |
+
A multi-modal Variational Autoencoder trained on NetHack game states for representation learning.
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
|
| 20 |
+
This model is a MultiModalHackVAE that learns compact representations of NetHack game states by processing:
|
| 21 |
+
- Game character grids (21x79)
|
| 22 |
+
- Color information
|
| 23 |
+
- Game statistics (blstats)
|
| 24 |
+
- Message text
|
| 25 |
+
- Bag of glyphs
|
| 26 |
+
- Hero information (role, race, gender, alignment)
|
| 27 |
+
|
| 28 |
+
## Model Details
|
| 29 |
+
|
| 30 |
+
- **Model Type**: Multi-modal Variational Autoencoder
|
| 31 |
+
- **Framework**: PyTorch
|
| 32 |
+
- **Dataset**: NetHack Learning Dataset
|
| 33 |
+
- **Latent Dimensions**: 96
|
| 34 |
+
- **Low-rank Dimensions**: 0
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from train import load_model_from_huggingface
|
| 40 |
+
import torch
|
| 41 |
+
|
| 42 |
+
# Load the model
|
| 43 |
+
model = load_model_from_huggingface("CatkinChen/nethack-vae-hmm")
|
| 44 |
+
|
| 45 |
+
# Example usage with synthetic data
|
| 46 |
+
batch_size = 1
|
| 47 |
+
game_chars = torch.randint(32, 127, (batch_size, 21, 79))
|
| 48 |
+
game_colors = torch.randint(0, 16, (batch_size, 21, 79))
|
| 49 |
+
blstats = torch.randn(batch_size, 27)
|
| 50 |
+
msg_tokens = torch.randint(0, 128, (batch_size, 256))
|
| 51 |
+
hero_info = torch.randint(0, 10, (batch_size, 4))
|
| 52 |
+
|
| 53 |
+
with torch.no_grad():
|
| 54 |
+
output = model(
|
| 55 |
+
glyph_chars=game_chars,
|
| 56 |
+
glyph_colors=game_colors,
|
| 57 |
+
blstats=blstats,
|
| 58 |
+
msg_tokens=msg_tokens,
|
| 59 |
+
hero_info=hero_info
|
| 60 |
+
)
|
| 61 |
+
latent_mean = output['mu']
|
| 62 |
+
latent_logvar = output['logvar']
|
| 63 |
+
lowrank_factors = output['lowrank_factors']
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Training
|
| 67 |
+
|
| 68 |
+
This model was trained using adaptive loss weighting with:
|
| 69 |
+
- Embedding warm-up for quick convergence
|
| 70 |
+
- Gradual raw reconstruction focus
|
| 71 |
+
- KL beta annealing for better latent structure
|
| 72 |
+
|
| 73 |
+
## Citation
|
| 74 |
+
|
| 75 |
+
If you use this model, please consider citing:
|
| 76 |
+
|
| 77 |
+
```bibtex
|
| 78 |
+
@misc{nethack-vae,
|
| 79 |
+
title={MultiModalHackVAE: Multi-modal Variational Autoencoder for NetHack},
|
| 80 |
+
author={Xu Chen},
|
| 81 |
+
year={2025},
|
| 82 |
+
url={https://huggingface.co/CatkinChen/nethack-vae-hmm}
|
| 83 |
+
}
|
| 84 |
+
```
|