← all repositories

davda54/sam

A PyTorch optimizer wrapper implementing Sharpness-Aware Minimization to improve deep learning model generalization.

2k stars Python ML Frameworks
sam
Velocity · 7d
+1.0
★ / day
Trend
steady
star history

This repository provides an unofficial implementation of SAM and ASAM optimizers for PyTorch. SAM works by performing two forward-backward passes to compute a regularized sharpness-aware gradient, which is then passed to an underlying optimizer like SGD with momentum. The technique leads to wider loss minima and improved generalization across various datasets, with robustness to label noise comparable to specialized noisy-label training procedures.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.