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

Unify keyword argument names for convolution and pooling #207

Closed
f0k opened this issue Apr 13, 2015 · 8 comments · Fixed by #210
Closed

Unify keyword argument names for convolution and pooling #207

f0k opened this issue Apr 13, 2015 · 8 comments · Fixed by #210
Milestone

Comments

@f0k
Copy link
Member

f0k commented Apr 13, 2015

The keyword argument names for 1D and {2,3}D convolution and pooling are currently not the same.

I'd suggest to use filter_size and stride for all convolutions, and pool_size and stride for all poolings.
For a really uniform interface, it would be nice if all of filter_size, pool_size and stride either accepted a single integer or a tuple of integers matching the dimensionality.

Arguments for or against it?

@ebenolson
Copy link
Member

how about copying Caffe and using kernel_size for both conv and pool?

@benanne
Copy link
Member

benanne commented Apr 13, 2015

Sounds like a good compromise. And I suppose having them be consistent across dimensionalities makes the interface a bit 'smaller', so I'm in favour.

Having all of them accept both tuples and single integers is also a great idea, and shouldn't be too complicated to implement cleanly.

how about copying Caffe and using kernel_size for both conv and pool?

kernel_size makes no sense for pooling operations imo, there is no kernel involved.

@benanne
Copy link
Member

benanne commented Apr 13, 2015

Maybe we could have a helper function that takes an integer or tuple as input, as well as the desired dimensionality. If the first input is a tuple, it checks if it has the right length and simply returns it. If the first input is an integer, it turns it into a tuple of the correct length.

This could be used in both the pooling and the convolution implementations.

@ebenolson
Copy link
Member

yeah, I did something like that here but it would be a good helper function.

@f0k
Copy link
Member Author

f0k commented Apr 13, 2015

I like @ebenolson's approach of accepting any iterable, not just tuples. We could do that in more places. (But that's something we can always add later on, as it doesn't break backwards compatibility.) And speaking of helper functions, there's a lot more code duplication in the convolution layers that could use some refactoring, but that's also not critical for the first release.

Anyone please feel free to rename the keyword arguments as discussed above and/or add the integer/tuple handling, I'm currently spending the little Lasagne time I have on #182. It's a low-hanging fruit we can leave open for a bit until somebody comes a long and picks it. If you're a possible new contributor reading this, please step closer :)

@f0k f0k added this to the First release milestone Apr 13, 2015
@benanne
Copy link
Member

benanne commented Apr 13, 2015

I wouldn't leave this open for more than a couple of days though, ds -> pool_size is going to be a breaking change that affects a lot of code and it would be nice to have a warning for that for at least a week or so :)

@benanne benanne mentioned this issue Apr 16, 2015
@ebenolson
Copy link
Member

I can take care of this. Do we want people's code to break now, or continue to accept the old parameter names and give a deprecation warning?

@benanne
Copy link
Member

benanne commented Apr 16, 2015

Thinking about it again, adding deprecation warnings for this is going to clutter the code a lot, and it would only be for a few weeks anyway. I don't think it's necessary to spend time on that. We'll post a bulletin on the mailing list when it's released.

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

Successfully merging a pull request may close this issue.

3 participants