Views
No views yet
Holvoet, F., Blier-Wong, C., & Antonio, K. (2025). A multi-view contrastive learning framework for spatial embeddings in risk modeling. arXiv preprint arXiv:2511.17954.
EU16_GS32_OSM16.ckptEU16_OSM16.ckptEU32_GS96_OSM32.ckptEU64_GS64.ckptEU8_GS32_OSM32.ckpt1from huggingface_hub import hf_hub_download
2from load_lightweight import get_mvloc_encoder
3import torch
4
5device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
6
7# Example coordinates (latitude, longitude) of various European cities
8c = torch.tensor([
9 (50.8503, 4.3517), # Brussels
10 (48.8566, 2.3522), # Paris
11 (51.5074, -0.1278), # London
12 (52.5200, 13.4050), # Berlin
13 (41.9028, 12.4964), # Rome
14 (40.4168, -3.7038), # Madrid
15 (59.3293, 18.0686), # Stockholm
16 (60.1699, 24.9384), # Helsinki
17 (47.4979, 19.0402), # Budapest
18 (48.2082, 16.3738), # Vienna
19], dtype=torch.float32)
20
21model = get_mvloc_encoder(
22 hf_hub_download("FreekH/multiview_spatial_embedding", "MODEL_NAME.ckpt"),
23 device=device
24)
25model.to(device)
26
27with torch.no_grad():
28 emb = model(c.to(device).double()).detach().cpu().numpy()MODEL_NAME.ckpt with the desired model filename from the list above. The GitHub repository contains a Jupyter Notebook, called Add_embeddings_to_data.ipynb, that includes a function to systematically add embeddings to a data set containing a latitude and a longitude feature.1@article{holvoet2025multiview,
2 title={A multi-view contrastive learning framework for spatial embeddings in risk modeling},
3 author={Holvoet, Freek and Blier-Wong, Christopher and Antonio, Katrien},
4 journal={arXiv preprint arXiv:2511.17954},
5 year={2025}
6}1@misc{holvoet_pretrainedmodels,
2 author = { Freek Holvoet },
3 title = { Spatial embeddings via multiview contrastive learning},
4 year = 2025,
5 note = {[Pretrained spatial embedding models]},
6 url = { https://huggingface.co/FreekH/multiview_spatial_embedding },
7 doi = { 10.57967/hf/7009 },
8 publisher = { Hugging Face }
9}