-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLS and parameter groups for larger datasets? #3
Comments
so FastAI creates 2 param groups to split out l1 and l2 params....I've made a temp function to avoid that: `def filter_all_params_no_split(layer_groups:Collection[nn.Module])->List[List[nn.Parameter]]: return pure |
You are right that we should include param groups to be consistent with other optimizers. We will add that by the end of this week. Thanks for pointing this out! |
Hi @IssamLaradji |
Thanks a lot. I added param_groups, let me know how that works for you! thanks :) |
Excellent - testing it now! |
It's handling the param groups in the respect it doesnt' blow up like before. |
Layer Groups Len 1 Parameter Group 1 Parameter Group 1 |
I'll pickup on it again tomorrow and try to isolate it more. I can't tell exactly where it's not working at this point, but it's at least running now in FastAI with param groups vs couldn't get it runnning earlier :) |
oh thanks for testing, could you pass me the script you used to reproduce the figure you generated with |
Hi @IssamLaradji - here's a relevant snippet but not sure how much that will help you. I had to make changes to three different FastAI files to get SLS to run as FastAI doesn't expect to have a closure, not call loss.backwards(), etc. If you have teamviewer maybe we can do a quick call on Thursday and I can walk you through the whole thing? (I'm in Seattle, WA PST). |
Hi @lessw2020, sorry I am out of town and will be back later this week. We can use teamviewer coming Monday if you like! On another note, does FastAI implement lbfgs? because lbfgs requires a closure to perform the line-search just like SLS. |
Hi @IssamLaradji - Monday works great. FastAI does not have lbfgs...I've had some discussions with Jeremy about how FastAI v2 can support optimizers like SLS, AliG, etc. that require passing in a loss or closure and hoping to use SLS to make the changes in the framework. |
Thanks @lessw2020 , let's correspond there on Facebook :) |
I'm hitting an issue though in using/testing as the code seems to assume no parameter groups?
(from utils.py)
def get_grad_list(params):
return [p.grad for p in params]
this fails b/c p.grad is inside each param group ala
for group in self.param_groups:
for p in group["params"]:
if p.grad is None: <-- now you can access p.grad
Is there a way to adjust to handle parameter groups? I'm trying to integrate into FastAI which by default will create two param groups. I'll see if I can avoid that but I think param groups are quite common in most platforms so any tips here would be appreciated.
The text was updated successfully, but these errors were encountered: