Downloads · 30 days
0
DanielRegaladoCardoso/loopback-twotower
loopback-twotower is a machine learning model from DanielRegaladoCardoso. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as apache-2.0.
Open-source two-tower neural recommender for music, trained from scratch on the Last.fm 1K users dataset. Repo: <https://github.com/DanielRegaladoUMiami/loopback.
Downloads · 30 days
0
Access
Public
Updated May 18, 2026
Repo size
429 MB
Likes
0
Public
Click a slice to open those files.
.pt429 MB · 100%
From the Hugging Face model README
Open-source two-tower neural recommender for music, trained from scratch on the Last.fm 1K users dataset. Repo: https://github.com/DanielRegaladoUMiami/loopback.
User tower: user_id ──► Embedding(64) ──► MLP(256→128) ──► L2-norm ──► user_vec
Track tower: track_id ──► Embedding(64) ┐
artist_id ─► Embedding(64) ┴► MLP(256→128) ──► L2-norm ──► track_vec
score = u · t * exp(temp)
Loss: symmetric InfoNCE (CLIP-style) with in-batch negatives and a learnable temperature.
Evaluated on 847 held-out users with seen-track filtering against the full 1.5 M-track catalog:
| Metric | Value | Random baseline |
|---|---|---|
| Recall@10 | 0.0708 | 6.7 e-6 |
| Recall@50 | 0.2172 | 3.3 e-5 |
| Recall@100 | 0.3140 | 6.7 e-5 |
import torch
from huggingface_hub import hf_hub_download
from loopback.model import TwoTower # from github.com/DanielRegaladoUMiami/loopback
ckpt = torch.load(hf_hub_download("DanielRegaladoCardoso/loopback-twotower", "two_tower_epoch3.pt"),
map_location="cpu", weights_only=False)
model = TwoTower(992, 1_500_661, 174_091, out_dim=ckpt["embed_dim"])
model.load_state_dict(ckpt["model"])
model.eval()
Apache 2.0