-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
S01E06 Convert convolution rules from using arma::Mat<eT> to MatType
#3608
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
Conversation
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
shrit
left a comment
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.
| MatType tmp = arma::conv_to<MatType>::from(U.unsafe_col(0)); | ||
| NaiveConvolution<BorderMode>::Convolution(subOutput, tmp, |
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.
This is necessary since it was passing a Col and now only accepts MatType, which should always be a MatType. I do not think this should have some performance issue, hopefully not.
if you have a better proposal, please let me know
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.
It doesn't work to just leave U.unsafe_col(0) here? That should return MatType (for Armadillo types).
There will later need to be a rethink here, since Bandicoot doesn't implement unsafe_col() and I'm not sure it makes sense for it to.
rcurtin
left a comment
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.
The changes look fine to me, but I think we should figure out the unsafe_col() issue before merge. 👍
| MatType tmp = arma::conv_to<MatType>::from(U.unsafe_col(0)); | ||
| NaiveConvolution<BorderMode>::Convolution(subOutput, tmp, |
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.
It doesn't work to just leave U.unsafe_col(0) here? That should return MatType (for Armadillo types).
There will later need to be a rethink here, since Bandicoot doesn't implement unsafe_col() and I'm not sure it makes sense for it to.
|
@rcurtin I have tried, but the tests fail, because the Convultion function expects three |
|
I think you should be able to solve this by adding more template parameters (one for each argument, for instance). That will allow the filter to take a different type, if needed. I would suspect that the reason |
Signed-off-by: Omar Shrit <[email protected]>
|
@rcurtin This is the real reason that Since it is not a real I would say, let us merge it in this state, technically, we need to find a nicer implementation for these functions with bandicoot, and I do not know the answer to this, adding overloads looks really ugly, it would be nice to have a generic function that would work with both libraries |
|
Ah. I see, thanks for digging into that. That is indeed going to be more complicated than I thought. I agree with your assessment that we should save it for later then. |
rcurtin
left a comment
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.
Looks good to me. Up to you if you want to revert 677287f before merge.
|
I will keep it like this because we will have to refactor this anyway so that we will come back to it. |
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.
Second approval provided automatically after 24 hours. 👍
No description provided.