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

Finishing touches on @bhack's SliceLayer (#680) #755

Merged
merged 2 commits into from
Jul 22, 2014

Conversation

jeffdonahue
Copy link
Contributor

Finishes #680. Thanks for contributing this layer @bhack, and thanks for your review @sguada. Will merge once Travis passes.

ste-m5s and others added 2 commits July 22, 2014 00:20
Differentiate top test blob vector size

Rename to SplitLayer
Add slicing points
suggested by @sguada).  Test for both num & channels in forward &
backward; use GaussianFiller so that tests are non-trivial.
jeffdonahue added a commit that referenced this pull request Jul 22, 2014
@jeffdonahue jeffdonahue merged commit 9959058 into BVLC:dev Jul 22, 2014
@jeffdonahue jeffdonahue mentioned this pull request Jul 22, 2014
@jeffdonahue jeffdonahue deleted the bhack-split_dim branch July 22, 2014 09:05
@sguada
Copy link
Contributor

sguada commented Jul 22, 2014

@jeffdonahue thanks for the finishing touches, nice job @bhack

@bhack
Copy link
Contributor

bhack commented Jul 22, 2014

@jeffdonahue A general little stylistic question. How do we prefer to handle repeated element in Caffe? We want to copy to a vector with a for loop or we want to use std::copy?

@Yangqing
Copy link
Member

@bhack std::copy seems more reasonable. Please fix any for-loop copies as you see fit.

@bhack
Copy link
Contributor

bhack commented Jul 22, 2014

@Yangqing I don't know if we could collect here #760

mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
RazvanRanca pushed a commit to RazvanRanca/caffe that referenced this pull request Nov 4, 2014
return LayerParameter_LayerType_SLICE;
}
virtual inline int ExactNumBottomBlobs() const { return 1; }
virtual inline int MinTopBlobs() const { return 2; }
Copy link
Member

Choose a reason for hiding this comment

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

I am sort of confused here when I use this layer, and traced back to here... Why MinTopBlobs() returns 2? (why not 1?)

Copy link
Contributor

Choose a reason for hiding this comment

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

@ronghanghu Slice is a knife for a blob. A division by 1 exist in math. But is it operative useful when you are cooking?

Copy link
Member

Choose a reason for hiding this comment

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

You are right :)

I was trying to use slice layer as a component in another layer to automatically slice a blob of shape T x ... into T blobs of shape 1 x ..., and run into this error when T == 1. I'll handle the special case myself.

Choose a reason for hiding this comment

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

Why not allow for 1 top blob? I understand that it doesn't make sense to use a SliceLayer for that purpose, but if a user asks for it, the layer could act as a pass-through, doing nothing at all. This makes the layer more general.

Copy link
Contributor

Choose a reason for hiding this comment

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

If there are some derived reuse of this layer then could be extended to hande the Top 1 case in a way that not impact performance (cause it is a useless computation) so the logic doesn't need to be reproduced everywhere.

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 this pull request may close these issues.

7 participants