Views
No views yet
MODELS_INDEX.json in the repo root - it lists all trained models sorted by accuracy with links to weights and configs.AbstractPhil/david-shared-space/
├── MODELS_INDEX.json # 📊 Master index of all models (sorted by accuracy)
├── README.md # This file
├── best_model.json # Latest best model info
├── weights/
│ └── david_gated_expert_team/
│ └── 20251013_004438/
│ ├── MODEL_SUMMARY.txt # 🎯 Human-readable performance summary
│ ├── training_history.json # 📈 Epoch-by-epoch training curve
│ ├── best_model_acc62.94.safetensors # ⭐ Accuracy in filename!
│ ├── best_model_acc62.94_metadata.json
│ ├── final_model.safetensors
│ ├── checkpoint_epoch_X_accYY.YY.safetensors
│ ├── david_config.json
│ └── train_config.json
└── runs/
└── david_gated_expert_team/
└── 20251013_004438/
└── events.out.tfevents.* # TensorBoard logs1from geovocab2.train.model.core.david import David, DavidArchitectureConfig
2from huggingface_hub import hf_hub_download
3
4# Browse available models in MODELS_INDEX.json first!
5
6# Specify model variant and run
7model_name = "david_gated_expert_team"
8run_id = "20251013_004438"
9accuracy = "62.94" # From MODELS_INDEX.json
10
11# Download config
12config_path = hf_hub_download(
13 repo_id="AbstractPhil/david-shared-space",
14 filename=f"weights/{model_name}/{run_id}/david_config.json"
15)
16config = DavidArchitectureConfig.from_json(config_path)
17
18# Download weights (accuracy in filename!)
19weights_path = hf_hub_download(
20 repo_id="AbstractPhil/david-shared-space",
21 filename=f"weights/{model_name}/{run_id}/best_model_acc{accuracy}.safetensors"
22)
23
24# Download training history (optional - see full training curve)
25history_path = hf_hub_download(
26 repo_id="AbstractPhil/david-shared-space",
27 filename=f"weights/{model_name}/{run_id}/training_history.json"
28)
29
30# Load model
31from safetensors.torch import load_file
32david = David.from_config(config)
33david.load_state_dict(load_file(weights_path))
34david.eval()1import torch
2import torch.nn.functional as F
3
4# Assuming you have CLIP features (512-dim for ViT-B/16)
5features = get_clip_features(image) # [1, 512]
6
7# Load anchors
8anchors_dict = torch.load("anchors.pth")
9
10# Forward pass
11with torch.no_grad():
12 logits, _ = david(features, anchors_dict)
13 predictions = logits.argmax(dim=-1)score = w_anchor * sim(z, anchor) + w_need * sim(z, need) + ...1@software{david_classifier_2025,
2 title = {David: Multi-Scale Feature Classifier},
3 author = {AbstractPhil},
4 year = {2025},
5 url = {https://huggingface.co/AbstractPhil/david-shared-space},
6 note = {Run ID: 20251013_004438}
7}