{"adoption": {"forks": 208, "observed_at": "2026-08-28T04:06:01.658550+00:00", "stars": 1980}, "canonical_url": "https://ross.abutalabs.com/products/sam", "card": {"archived": false, "artifact_type": "library", "description": "SAM: Sharpness-Aware Minimization (PyTorch)", "domain": ["machine-learning", "deep-learning"], "enriched": true, "function": ["machine-learning", "deep-learning"], "health_score": 20, "homepage": null, "language": "Python", "license": "MIT", "license_family": "permissive", "maturity": "stable", "member_repos": ["davda54/sam"], "name": "davda54/sam", "platform": ["python"], "pushed_at": "2024-02-21T12:34:27+00:00", "repo": "davda54/sam", "stars": 1980, "tags": ["optimizer", "pytorch", "sharpness-aware-minimization", "asam", "generalization"], "topics": ["optimizer", "pytorch", "sam", "sharpness-aware"], "urls": [], "use_cases": ["improve generalization of deep neural networks in pytorch", "train models that find flat minima instead of sharp ones", "make training robust to noisy labels", "reproduce SAM paper results on cifar10", "wrap SGD or Adam with sharpness-aware gradient updates"], "what_it_is": "An unofficial PyTorch implementation of Sharpness-Aware Minimization (SAM) and its adaptive variant ASAM, provided as an optimizer wrapper around base optimizers like SGD. It minimizes both loss value and loss sharpness to improve model generalization and robustness to label noise.", "when_to_avoid": ["training speed is critical, since SAM requires two forward-backward passes per step", "you use frameworks other than PyTorch", "you need an officially maintained implementation with frequent updates"], "when_to_choose": ["you train PyTorch models and want better generalization at the cost of ~2x training time", "you need an easy drop-in optimizer wrapper implementing SAM or ASAM", "your dataset suffers from label noise"]}, "data_as_of": "2026-08-30T08:39:29.467469+00:00", "members": [{"path": "/products/sam", "repo": "davda54/sam", "role": "main", "score": 32}], "provenance": {"archived": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "artifact_type": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "description": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "domain": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "enriched": {"inputs": [], "kind": "computed", "method": "enrichment_status"}, "function": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "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:01.658550+00:00", "source": "github"}, "language": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "license": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "license_family": {"inputs": ["license"], "kind": "computed", "method": "license_family"}, "maturity": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "member_repos": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "name": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "platform": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "pushed_at": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "repo": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "stars": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "tags": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "topics": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "urls": {"kind": "observed", "observed_at": "2026-08-28T04:06:01.658550+00:00", "source": "github"}, "use_cases": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "what_it_is": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "when_to_avoid": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "taxonomy_version": 1}, "when_to_choose": {"confidence": null, "enriched_at": "2026-08-30T03:04:00.231569+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "7a103d4abecf6367e160fc7c6e7536087b17fa16324887e2fdccd09230e8e217", "fetched_at": "2026-08-28T04:06:01.658550+00:00", "kind": "readme", "missing": false, "url": "https://github.com/davda54/sam"}], "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": 2138, "days_push": 924, "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}}