efficient_sam's People
efficient_sam's Issues
Where is run.sh and Can ESAM be integrated with pytorch lightning?
BTW, there is a minor typo in ESAM init.
Tests on VIT
Could you please provide a demo code for training VIT?
the mask in your implementation is inconsistent with your paper
Based on your implementation Esam.py
, same parameters are randomly masked at the descent step (i.e., the second step as follows).
But in your paper (the paragraph above eq(5)), the mask is added to the perturbance
As they are very different, could you please provide some explanations?
@torch.no_grad()
def second_step(self, zero_grad=False):
for group in self.param_groups:
for p in group["params"]:
if p.grad is None or not self.state[p]: continue
p.sub_(self.state[p]["e_w"]) # get back to "w" from "w + e(w)"
self.state[p]["e_w"] = 0
if random.random() > self.beta:
p.requires_grad = False
self.base_optimizer.step() # do the actual "sharpness-aware" update
if zero_grad: self.zero_grad()
The code is slightly different from the Algorithm proposed in the paper
The line 26 of Esam.py is different from the original algorithm 1 proposed in the paper, i.e., beta in the code vs. (1 - beta) in the paper.
Could you provide code for training imagenet?Thank you!
Support for multiple loss functions and GradScaler
I came across your work and you did a fantastic job in improving the performance of SAM.
It seems that the current implementation supports only a single loss function.
While the code example does include the case for fp16, there are no mentions of gradient scaling, which is commonly used together in AMP.
Are there any plans to support multiple loss functions and GradScaler?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.