Views
No views yet
uv add "canvit-pytorch @ git+https://github.com/m2b3/CanViT-PyTorch.git"1import torch
2from canvit_pytorch.probes import SegmentationProbe
3
4probe = SegmentationProbe.from_pretrained("canvit/probe-ade20k-40k-s512-c24-in21k").eval()
5
6# [B, H, W, D] canvas features from a CanViT forward pass
7features = torch.randn(1, 24, 24, 1024)
8with torch.inference_mode():
9 logits = probe(features) # [B, num_classes, H, W]
10assert logits.shape == (1, 150, 24, 24)LayerNorm → Dropout → BatchNorm → Conv1×1.| Hyperparameter | Value |
|---|---|
| Scene size | 512 px |
| Canvas grid | 24 × 24 |
| Glimpse size | 128 px |
| Timesteps (T) | 10 |
| Training policy | R-IID |
| Optimizer | AdamW |
| Peak LR | \( 3 \times 10^{-4} \) |
| Weight decay | \( 10^{-3} \) |
| LR schedule | 1,500-step warmup → cosine decay |
| Batch size | 16 |
| Max steps | 40,000 |
| Dropout | 0.1 |
| Augmentation | RandomResizedCrop scale [0.5, 2] + HFlip |
| Precision | bf16 (AMP) |