CoinCheung/pytorch-loss
label-smooth, amsoftmax, partial-fc, focal-loss, triplet-loss, lovasz-softmax. Maybe useful observed · 2026-08-28
Health v2 · maintenance only
32/100
- Activity 0
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2702
- days_rel: n/a
- days_push: 686
- n_releases_24m: 0
Adoption not part of the score
2252 stars · 372 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A PyTorch library providing a collection of loss functions (focal loss, triplet loss, AMSoftmax, label-smooth CE, dice loss, lovasz-softmax, partial-Fc, etc.) plus utility ops like one-hot encoding, EMA, and custom activations. Some operators ship as CUDA extensions for faster, more memory-efficient execution.
Use cases
- train image segmentation models with dice or lovasz loss
- apply focal loss for class imbalance in detection
- use triplet loss or AMSoftmax for face recognition metric learning
- add label smoothing to cross-entropy training
- speed up loss computation with fused CUDA kernels
- use EMA of model weights during training
When to choose
- you need a broad set of ready-made PyTorch loss functions in one package
- you want CUDA-accelerated versions of losses for speed and memory efficiency
- you train face recognition or segmentation models and need margin-based or dice losses
When to avoid
- you need losses for frameworks other than PyTorch
- you cannot compile CUDA extensions and only want pure-PyTorch ops (though V1/V2 versions exist)
- you want a maintained, extensively documented library with guarantees
Facets
library · maturity active
machine-learning deep-learning gpu-computing machine-learning deep-learning computer-vision image-processing python cross-platform pytorch loss-functions cuda-extension focal-loss triplet-loss amsoftmax label-smoothing dice-loss lovasz-softmax partial-fc activation-functions ema gpu linux
1 source
- readme: https://github.com/CoinCheung/pytorch-loss · fetched 2026-08-28 · c529e6c1a3c8
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| CoinCheung/pytorch-loss | main | 32 |
For agents
markdown · JSON · MCP: product_card(name="CoinCheung/pytorch-loss")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem