|
|
--- |
|
|
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 |
|
|
|