Skip to content

Conversation

@abh2k
Copy link
Member

@abh2k abh2k commented Feb 11, 2021

Added pixel shuffle layer

abh2k and others added 3 commits February 12, 2021 05:17
Updated Cereal_nvp
Added pixel shuffle to more_types
@abh2k
Copy link
Member Author

abh2k commented Feb 13, 2021

@zoq @kartikdutt18 Are there any more changes required in this pr.

Copy link
Member

@kartikdutt18 kartikdutt18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @abh2k, These are minor changes and a point to discuss on. Thanks for taking the time to create the PR.
Regards.

Comment on lines 71 to 76
arma::mat inputImage = input.col(n);
arma::mat outputImage = output.col(n);
arma::cube inputTemp(const_cast<arma::mat&>(inputImage).memptr(), height,
width, size, false, false);
arma::cube outputTemp(const_cast<arma::mat&>(outputImage).memptr(),
outputHeight, outputWidth, sizeOut, false, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this but maybe we can do this without the creating copies (which add to latency / space utilization). If

arma::cube inputTemp(const_cast<arma::mat&>(input.col(n)).memptr(), height,
          width, size, false, false);

doesn't work, we can

arma::cube inputTemp(const_cast<arma::mat&>(input).memptr(), height,
          width, size * batchSize, false, false);

and then use span. That way we don't create copies.
Also save time on copying back (maybe). Let me know incase I missed something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartikdutt18 @zoq I made the required changes. Now the copying step has been removed. Please review.

Co-authored-by: kartikdutt18 <[email protected]>
@abh2k abh2k force-pushed the pixel_shuffle branch 2 times, most recently from 075881a to 7b70a82 Compare February 15, 2021 01:39
@kartikdutt18 kartikdutt18 self-requested a review February 23, 2021 14:13
Copy link
Member

@kartikdutt18 kartikdutt18 left a 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!
Thanks a lot for the contribution.
Regards.

@@ -0,0 +1,180 @@
/**
* @file methods/ann/layer/pixel_shuffle.hpp
* @author Anjishnu Mukherjee
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to add yourself as co-author.

@abh2k abh2k mentioned this pull request Feb 26, 2021
Copy link

@mlpack-bot mlpack-bot bot left a 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. 👍

Copy link
Member

@birm birm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following up on #2563 :)

@birm birm merged commit 338f583 into mlpack:master Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants