Downloads ยท 30 days
0
AbstractPhil/geofractal-david
geofractal-david is a image classification model from AbstractPhil. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
GeoFractalDavid achieves classification through geometric compatibility rather than cross-entropy. Features must "fit" geometric signatures: k-simplex shapes, Cantor positions, and hierarchical structure.
Downloads ยท 30 days
0
Access
Public
Updated Oct 16, 2025
Repo size
30.2 GB
Likes
0
Public
Click a slice to open those files.
.safetensors6.3 GB ยท 98%
From the Hugging Face model README
GeoFractalDavid achieves classification through geometric compatibility rather than cross-entropy. Features must "fit" geometric signatures: k-simplex shapes, Cantor positions, and hierarchical structure.
Model Type: Multi-scale geometric basin classifier
Core Components:
Geometric Components:
Each scale learns to weight these components differently.
The alpha parameter controls middle-interval weighting in the Cantor staircase.
The Cantor staircase uses soft triadic decomposition with learnable alpha to map features into [0,1] space with fractal structure.
Each class has a learned scalar Cantor prototype. The model pulls features toward their class's Cantor position.
Scale 384D:
Scale 512D:
Scale 768D:
Scale 1024D:
Scale 1280D:
Most classes cluster around 0.5 (middle Cantor region), with smooth spread across [0,1]. This creates a continuous manifold rather than discrete bins.
Each scale learns optimal weights for combining geometric components:
Scale 384D: Feature=0.929, Cantor=0.020, Crystal=0.051 Scale 512D: Feature=0.885, Cantor=0.023, Crystal=0.092 Scale 768D: Feature=0.996, Cantor=0.001, Crystal=0.003 Scale 1024D: Feature=0.952, Cantor=0.005, Crystal=0.043 Scale 1280D: Feature=0.411, Cantor=0.003, Crystal=0.587
Pattern: Lower scales rely on feature similarity, higher scales use crystal geometry. This hierarchical strategy emerges from training.
import torch
from safetensors.torch import load_file
from geovocab2.train.model.core.geo_fractal_david import GeoFractalDavid
# Load model
model = GeoFractalDavid(
feature_dim=512,
num_classes=1000,
k=5,
scales=[256, 384, 512, 768, 1024, 1280],
alpha_init=0.5,
tau=0.25
)
state_dict = load_file("weights/.../best_model_acc{best_acc:.2f}.safetensors")
model.load_state_dict(state_dict)
model.eval()
# Inference
with torch.no_grad():
logits = model(features) # [batch_size, 1000]
predictions = logits.argmax(dim=-1)
# Inspect learned structure
print(f"Global Alpha: {{model.cantor_stairs.alpha.item():.4f}}")
geo_weights = model.get_geometric_weights()
cantor_dist = model.get_cantor_interval_distribution(sample_features)
Loss Function: Contrastive Geometric Basin
Optimization:
Data:
Hub Upload: {"Periodic (every " + str(config.hub_upload_interval) + " epochs)" if config.hub_upload_interval > 0 else "End of training only"}
No Cross-Entropy on Arbitrary Weights
Traditional: cross_entropy(W @ features + b, labels)
Geometric Basin: contrastive_loss(compatibility_scores, labels)
Result: Classification emerges from geometric organization, not arbitrary mappings.
The repository includes visualizations of learned structure:
See weights/{model_name}/{config.run_id}/ for generated plots.
weights/{model_name}/{config.run_id}/
โโโ best_model_acc{best_acc:.2f}.safetensors # Model weights
โโโ best_model_acc{best_acc:.2f}_metadata.json # Training metadata
โโโ train_config.json # Training configuration
โโโ training_history.json # Epoch-by-epoch history
โโโ cantor_prototypes_distribution.png # Histogram analysis
โโโ cantor_prototypes_sorted.png # Sorted manifold view
โโโ cantor_prototypes_cross_scale.png # Cross-scale comparison
runs/{model_name}/{config.run_id}/
โโโ events.out.tfevents.* # TensorBoard logs
Note: Visualizations (*.png) are generated by running the probe script and should be copied to the weights directory before uploading to Hub.
This architecture demonstrates:
The geometric constraints guide learning toward structured representations without explicit supervision of the geometric components.
@software{{geofractaldavid2025,
title = {{GeoFractalDavid: Geometric Basin Classification}},
author = {{AbstractPhil}},
year = {{2025}},
url = {{https://huggingface.co/{config.hf_repo if config.hf_repo else 'MODEL_REPO'}}},
note = {{Multi-scale geometric basin classifier with k-simplex structure}}
}}
MIT License - See LICENSE file for details.
Model trained on {datetime.now().strftime('%Y-%m-%d')}
Run ID: {config.run_id}