geovit-david-beans / README.md
AbstractPhil's picture
Update main README
da18c24 verified
---
library_name: pytorch
license: apache-2.0
tags:
- vision
- image-classification
- geometric-deep-learning
- vit
- cantor-routing
- pentachoron
- multi-scale
---
# πŸ«˜πŸ’Ž DavidBeans: Unified Vision-to-Crystal Architecture
This repository contains training runs for DavidBeans - a unified geometric deep learning architecture combining:
- **BEANS (ViT Backbone)**: Cantor-routed sparse attention
- **DAVID (Classifier)**: Multi-scale crystal projection with Cayley-Menger geometric regularization
## Repository Structure
```
AbstractPhil/geovit-david-beans/
β”œβ”€β”€ README.md (this file)
└── weights/
β”œβ”€β”€ run_001_baseline_YYYYMMDD_HHMMSS/
β”‚ β”œβ”€β”€ best.safetensors
β”‚ β”œβ”€β”€ epoch_010.safetensors
β”‚ β”œβ”€β”€ config.json
β”‚ β”œβ”€β”€ training_config.json
β”‚ └── tensorboard/
β”œβ”€β”€ run_002_5expert_5scale_YYYYMMDD_HHMMSS/
β”‚ └── ...
└── ...
```
## Usage
```python
from safetensors.torch import load_file
from david_beans import DavidBeans, DavidBeansConfig
import json
# Pick a run
run_path = "weights/run_002_5expert_5scale_20251129_171229"
# Load config
with open(f"{run_path}/config.json") as f:
config_dict = json.load(f)
config = DavidBeansConfig(**config_dict)
# Load model
model = DavidBeans(config)
state_dict = load_file(f"{run_path}/best.safetensors")
model.load_state_dict(state_dict)
# Inference
model.eval()
with torch.no_grad():
output = model(images)
predictions = output['logits'].argmax(dim=-1)
```
## Training Runs
| Run | Name | Accuracy | Notes |
|-----|------|----------|-------|
| 001 | baseline | 70.05% | Initial CIFAR-100 run |
| 002 | 5expert_5scale | 68.34% | 5 experts, 5 scales |
## Architecture
```
Image [B, 3, 32, 32]
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ BEANS BACKBONE β”‚
β”‚ β”œβ”€ Patch Embed β†’ [64 patches, dim] β”‚
β”‚ β”œβ”€ Hybrid Cantor Router β”‚
β”‚ β”œβ”€ N Γ— Attention Blocks β”‚
β”‚ └─ N Γ— Pentachoron Expert Layers β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DAVID HEAD β”‚
β”‚ β”œβ”€ Multi-scale projection β”‚
β”‚ β”œβ”€ Per-scale Crystal Heads β”‚
β”‚ └─ Geometric Fusion β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
[num_classes]
```
## License
Apache 2.0