-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Repeat and Replicate ANN Layer Types #3565
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
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.
Thanks, these are important and nice layers to add. Sorry it took me so long to get to this review. I only did a quick pass so far---most of my specific comments are style-related, or comment-related.
The two classes are very similar. I wonder if it makes more sense to the user if we just create one layer Repeat, and whether it interleaves (like repelem()) or block copies (like repmat()) is a boolean parameter. What do you think?
I definitely had that thought. It seemed that the two concepts are kept separate with some other frameworks, so I was just sort of mirroring that. I only actually had use for the Replicate one, but figured I'd add both for completeness. Could go either way. |
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
|
Hm. Perceptron test is failing on MacOS. Is this a known issue? Obviously not related to this commit. And it succeeds on my local machine (which is MacOS, and same Armadillo version) for what it's worth. |
|
Is the perceptron test failing on other branches? This is on the MacOS builds. Doesn't fail on my mac with same armadillo version. |
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
|
When the decision_tree_regressor test fails, this is the output: /home/vsts/work/1/s/src/mlpack/tests/decision_tree_regressor_test.cpp:955: FAILED: Any idea of 6.1 was chosen with some mathematical reasoning (as opposed to empirically chosen)? If not, any objection to changing it to 6.2? |
|
Sorry, forgot to mention it here, but I opened #3594 to fix the decision tree regressor issues. If I had to guess, the tolerance was originally 6.0 (set somewhat arbitrarily by observation), then bumped to 6.1, and I think in #3594 I bumped to 6.2 and/or allowed multiple trials for it. Anyway, there were no failures in that test suite in 1000 trials, so if you merge master into this branch, at least that test should be fixed. :) |
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.
Looks good to me 👍
This reverts commit 0253a86.
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
| template<typename MatType> | ||
| struct GetUIntColType | ||
| { | ||
| typedef typename MatType::elem_type eT; | ||
| typedef typename std::conditional< | ||
| std::is_same<eT, arma::uword>::value, eT, arma::uword>::type elem; | ||
| typedef arma::Col<elem> type; | ||
| }; | ||
|
|
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.
@rcurtin I tried this, I do not know if you might like it or not
Regspace should be used on vectors, however, in the following we were assigning it to a matrix instead and then calling reshape. Now when using templates this is no longer possible, therefore we need to explicitly call conv_to to convert it from col to matrix. Signed-off-by: Omar Shrit <[email protected]>
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.
@shrit just some minor comments. If you can handle those then from my side I think everything is ready to merge. @akropp sorry this has been held up so long, thanks again for the implementation! I know we made a couple of changes after you were done so let us know if we accidentally broke any of your ideas or anything.
Signed-off-by: Omar Shrit <[email protected]>
Adding two ANN layer types:
RepeatType-- Repeat input tensors along one dimension n times, similar to thearma::repelemfunction ortensorflow.repeatReplicateType-- Replicate the input in a block-like fasion across each dimension a specified number of times, similar toarma::repmatortensorflow.tile