Ross ROSS = Recommend OSS · open-source software intelligence for agents

davda54/sam

SAM: Sharpness-Aware Minimization (PyTorch) observed · 2026-08-28

github.com/davda54/sam · Python · MIT (permissive) 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: 2138
  • days_rel: n/a
  • days_push: 924
  • n_releases_24m: 0

Full methodology

Adoption not part of the score

1980 stars · 208 forks observed · 2026-08-28

What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded

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.

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

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

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

Facets

library · maturity stable

machine-learning deep-learning machine-learning deep-learning python optimizer pytorch sharpness-aware-minimization asam generalization

1 source

Member repositories

RepositoryRoleHealth v2
davda54/sammain32

For agents

markdown · JSON · MCP: product_card(name="davda54/sam")

Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem