-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Generalize bilinear filler to for N-D multilinear filler #3984
Conversation
While there is no reason this filler should be limited to 4-D, as it is now, this breaks backward compatibility as-is since there are existing definitions that make use of See #2213 for some earlier discussion of the naming. Thoughts @longjon? |
In the usual interpolation sense (i.e., as a function of coordinates), linear is not correct; bilinear functions are nonlinear functions which are separately linear in each of their arguments. The generalization of bilinear is multilinear. Perhaps these could be accepted as synonyms. |
Thanks for your suggestions. I agree that |
: Filler<Dtype>(param) {} | ||
virtual void Fill(Blob<Dtype>* blob) { | ||
CHECK_EQ(blob->num_axes(), 4) << "Blob must be 4 dim."; | ||
CHECK_EQ(blob->width(), blob->height()) << "Filter must be square"; | ||
CHECK_GT(blob->num_axes(), 3) << "Blob must have at least 3 dimensions."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be CHECK_GE
, if you want to test the condition "at least 3"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, thanks for pointing that out. I will change it. I never tested the code for 1d inputs, but it should work, too.
@christianpayer I second |
913d46c
to
92901af
Compare
@shelhamer Thanks for the comments. I changed the name to
in upgrade_proto.hpp/cpp? |
@christianpayer adding the check
Care to take a stab at it and we'll go from there? |
rename weight filler "bilinear" to "multilinear" and generalize it for N dimensions with variable scaling factors per dimension
92901af
to
fb5294e
Compare
@shelhamer Thanks for the code snippet. I just implemented upgrade_proto for weight fillers and hope that this is what you had in mind. |
Please do not merge this PR, as I implemented in the meantime a more general interpolation filler, that allows linear/cubic/lanczos interpolation and rewrites most of the code of this PR. |
Closed in favour of #4198. |
This branch changes the bilinear filler (#2213) to support an arbitrary number of dimensions. Also, different scaling factors for each dimension are supported. I changed the name of the filler from "bilinear" to "linear", as it suits better for its multi-dimensional functionality.
The usage of this filler is the same as before (see comments, or #2213). Tests are not included, but I plan to write some using python scikit-image.