Skip to content
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

it's better to make optimizer as a class. #17

Closed
xpqiu opened this issue Jul 25, 2018 · 6 comments
Closed

it's better to make optimizer as a class. #17

xpqiu opened this issue Jul 25, 2018 · 6 comments

Comments

@xpqiu
Copy link
Member

xpqiu commented Jul 25, 2018

from torch import optim

@FengZiYjun
Copy link
Contributor

We do not implement optimizers, only borrow them from pytorch. Currently a single function as an interface is enough. Making optimizer as a class is reasonable if it provides more functionalities.

@xpqiu
Copy link
Member Author

xpqiu commented Jul 26, 2018

Yes, but it's more convenient for users to choose optimizer by "selecting" the enumerated options instead of "typing" the name.

@xpqiu
Copy link
Member Author

xpqiu commented Jul 26, 2018

there is also a potential plan to implement some customized optimizers.

@choosewhatulike
Copy link
Member

Rewrite a optimizer class may be redundant. In Tester or Trainer, we actually use optimizers in Pytorch. And further implemented optimizer can inherit class Optimizer from Pytorch.

But I agree that choose optimizer should avoid tying names, maybe we can change optimizer.py to import all of optimizers and implemented customized optimizer.

from torch.optim import *
from XXoptim import XXoptimizer
...

And users can "selecting" different optimizer now.

@xpqiu
Copy link
Member Author

xpqiu commented Jul 26, 2018

agree

@FengZiYjun
Copy link
Contributor

all right

lyhuang18 added a commit that referenced this issue Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants