Team Ai
Modelpublic

ZACK777/hi-mapper

sourceHugging Faceapache-2.0updated 12d agoView on Hugging Face
0likes
Model Card

HI-Mapper — PromptPAR hyperbolic branch

Hyperbolic hierarchy mapper for PromptPAR, with the fixed Euclidean → Lorentz lift (running-norm scaler, stable distance, entailment cones). This repo includes source code plus the two ViT weights PromptPAR needs to run.

Weights

FileRoleSize
weights/ViT-L-14.ptOpenAI CLIP ViT-L/14 (PromptPAR backbone)~890 MB
weights/jx_vit_base_p16_224-80ecf9dd.pthImageNet ViT-B/16 (MM-former blocks init)~331 MB
bash
hf download ZACK777/hi-mapper --local-dir ./hi-mapper
# then point PromptPAR at:
#   .cache/clip/ViT-L-14.pt  ← copy from weights/ViT-L-14.pt
#   jx_vit_base_p16_224-80ecf9dd.pth ← copy from weights/

Code

hi_mapper/
  lorentz.py      # Lorentz manifold + EuclideanToLorentz
  tree.py         # entailment / sibling / radius losses
  hi_mapper.py    # DivHiMapper + PETA attr grouping
  hyp_diffusion.py

PETA results (new Euclidean→hyperbolic lift)

Dataset: PETA, PromptPAR flags: --use_textprompt --use_div --use_vismask --use_GL --use_mm_former. HI-Mapper default: c=0.2, hi_mapper_w=0.1, warmup 3 epochs, --use_attr_hierarchy.

Stage A — 1-epoch do-no-harm gate

Configepoch-1 mAAccF1notes
A_control (no HI-Mapper)0.61020.49720.6412baseline
A_default (HI-Mapper)0.63750.50590.6492+2.7 pts vs control
A_attr0.63750.50590.6492same as default (attr on)
Ar15 (`hyptarget_radius=1.5`)0.64060.49810.6407best epoch-1
A_prompt0.63450.50500.6483
Aw030 (`himapper_w=0.3`)0.62860.48940.6339

All HI-Mapper configs beat the no-HI-Mapper control at epoch 1 (old broken lift was ~0.615 and below historical baseline).

Stage B — compressed 15-epoch (partial: epochs 1–3 before interrupt)

EpochControl mAHI-Mapper mAHI-Mapper AccHI-Mapper F1`hi_mapper_loss` (epoch avg)
10.61020.61750.51390.65781.720
20.63370.67200.52880.66771.029
30.69430.69970.56340.69570.187

Key signal vs the old broken lift: hierarchical loss no longer floors at ~0.20 from epoch 1; it falls 1.72 → 0.19 by epoch 3 while mA stays ahead of the matched control.

Full 15-epoch Stage B and 100-epoch final runs were interrupted; re-launch to complete the table.

Reference (published PromptPAR, PETA)

mA 88.76 / Acc 82.84 / F1 89.18 (TCSVT 2024) — requires full 100-epoch cosine schedule.

Quick start

python
import torch
from hi_mapper import DivHiMapper

mapper = DivHiMapper(feat_dim=768, curvature=0.2, target_radius=1.0)
root, mid, leaves, hier_loss, prompt_loss, attr_loss = mapper(
    torch.randn(2, 5, 768), torch.randn(2, 768)
)

License

Apache-2.0 for HI-Mapper code. CLIP / ViT checkpoints retain their original licenses (OpenAI CLIP; Google / timm ImageNet ViT-B/16).