{"adoption": {"forks": 372, "observed_at": "2026-08-28T04:06:31.047119+00:00", "stars": 2252}, "canonical_url": "https://ross.abutalabs.com/products/pytorch-loss", "card": {"archived": false, "artifact_type": "library", "description": "label-smooth, amsoftmax, partial-fc, focal-loss, triplet-loss, lovasz-softmax. Maybe useful ", "domain": ["machine-learning", "deep-learning", "computer-vision", "image-processing"], "enriched": true, "function": ["machine-learning", "deep-learning", "gpu-computing"], "health_score": 20, "homepage": null, "language": "Python", "license": "MIT", "license_family": "permissive", "maturity": "active", "member_repos": ["CoinCheung/pytorch-loss"], "name": "CoinCheung/pytorch-loss", "platform": ["python", "cross-platform"], "pushed_at": "2024-10-17T01:41:43+00:00", "repo": "CoinCheung/pytorch-loss", "stars": 2252, "tags": ["pytorch", "loss-functions", "cuda-extension", "focal-loss", "triplet-loss", "amsoftmax", "label-smoothing", "dice-loss", "lovasz-softmax", "partial-fc", "activation-functions", "ema", "gpu", "linux"], "topics": ["pytorch", "dice-loss", "triplet-loss", "amsoftmax", "cuda", "label-smoothing", "focal-loss", "mish", "ema", "lovasz-softmax", "partial-fc"], "urls": [], "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"], "what_it_is": "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.", "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"], "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"]}, "data_as_of": "2026-08-30T08:39:29.467469+00:00", "members": [{"path": "/products/pytorch-loss", "repo": "CoinCheung/pytorch-loss", "role": "main", "score": 32}], "provenance": {"archived": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "artifact_type": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "description": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "domain": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "enriched": {"inputs": [], "kind": "computed", "method": "enrichment_status"}, "function": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "health_score": {"inputs": ["days_since_push", "days_since_release", "archived"], "kind": "computed", "method": "health_v1"}, "homepage": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "language": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "license": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "license_family": {"inputs": ["license"], "kind": "computed", "method": "license_family"}, "maturity": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "member_repos": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "name": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "platform": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "pushed_at": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "repo": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "stars": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "tags": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "topics": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "urls": {"kind": "observed", "observed_at": "2026-08-28T04:06:31.047119+00:00", "source": "github"}, "use_cases": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "what_it_is": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "when_to_avoid": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}, "when_to_choose": {"confidence": null, "enriched_at": "2026-08-30T02:43:48.437501+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "c529e6c1a3c8dd87a6faf7b5602cb3ba08caf58baa9980743df71dc596dbf725", "fetched_at": "2026-08-28T04:06:31.047119+00:00", "kind": "readme", "missing": false, "url": "https://github.com/CoinCheung/pytorch-loss"}], "taxonomy_version": 1}}, "score": {"components": {"activity": 0, "longevity": 100, "rhythm": 35}, "computed_at": "2026-09-03T02:20:16.233290+00:00", "flags": ["no_releases"], "formula": "round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)", "inputs": {"age_days": 2702, "days_push": 686, "days_rel": null, "gap_med": null, "n_releases_24m": 0}, "score": 32, "version": 2}, "staleness": {"enrichment_outdated": false, "low_confidence": false, "scrape_days": 9, "stale_scrape": false}}