-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Refactoring? #541
Comments
Good point, the API parameters should not grow infinitely... @mpariente do you have an idea or a specific recommendation? |
I took a stab at it.
|
@DrClick very nice work! do you have an idea of how to pass them as "groups"? |
Thanks for the quick answer :-) I would avoid grouping them into dictionaries, this gives the impression that there are less parameters but doesn't bring much IMO. There is the |
@mpariente +1 for creating callbacks, it's something we're juryrigging Trainer to do at my work :) I'm really swamped lately but I'd love to push our callback implementation upstream. Re: Grouping, I'm uncertain about the proposal if we're just passing the objects into the same constructor anyways as we may just be painting over the complexity. ie. what's the difference between doing dicts vs better namespacing? A potential suggestion would be a further refactor that separates out functionality into public facing callbacks, where each callback takes in their own parameters. having all 'distributed' functionality be in a callback could be an example. Proposal:
|
I like idea with callbacks... |
@jeffling I agree, grouping into dictionaries just gives an illusion that there are less parameters but it's a bad idea.
|
@tullie @neggert any thoughts? this is definitely a good conversation to have. One benefit of having everything flattened out is that it’s easy to see what’s possible. Downside is a long list of args. If we break up into namespaces callbacks (dicts are bad because the IDE can’t help with autocomplete), then we have logical groupings of functionality. downside, we add a bit of friction to the user. |
Some other points :
|
I believe that the documentation should be gradually upgraded/improved in follow-up PRs after #521 |
We need to seriously consider the downside of grouping. For example, Pandas's read_csv function ( https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html ) has ~50 arguments but it works like a charm. It's because its arguments are orthogonal to each other and it's well documented. IMHO, callbacks are for allowing users to define their own methods, not just parameter values. I might be wrong, but callbacks just for grouping arguments seems not very useful to me. |
I agree that it's getting to be a lot, but I think grouping/namespacing/similar just hides the problem. IMO we just need to be cognizant of the problem and be a little more careful about approving PRs that add more args. #536 is a good example of a use case that we can handle without adding a new arg. One other thing to think about with this huge number of arguments is that we keep seeing bugs because someone tried a combination of args that we haven't tested. This is something I've been thinking about, but I've yet to come up with a good solution that doesn't blow up our test time. |
@neggert yeah... same thought. Other than random sampling combinations not sure what else we could do. |
resolution to this:
|
Thanks for lightning, it's a nice tool.
Trainer
already has around 30 arguments and the PRs want to make it grow (see #516 and #539 for example). The more features, the more arguments and that's not really scalable IMHO.There are things which could be grouped into objects instead, are you considering refactoring
Trainer
?That would help the community see where the project is going and in which case to use it.
The text was updated successfully, but these errors were encountered: