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

Added TemporalRowConvolutionMM layer, tests, and documentation #1100

Merged
merged 23 commits into from Jan 27, 2017
Merged

Added TemporalRowConvolutionMM layer, tests, and documentation #1100

merged 23 commits into from Jan 27, 2017

Conversation

willfrey
Copy link
Contributor

@willfrey willfrey commented Jan 10, 2017

Added row convolutions (a.k.a. lookahead convolutions) as described in this paper.

@willfrey
Copy link
Contributor Author

This is ready for you to review.

Copy link
Member

@soumith soumith left a comment

Choose a reason for hiding this comment

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

just FYI, this is a 1d version of SpatialConvolutionMap with a one-to-one connection table (commonly used in many papers including LeCun'98 i think) :)

Please rename the layer to TemporalRowConvolution, drop the MM suffix. We had spent quite some time to get rid of the MM suffix and it's history across the nn repo, do not want this to become another historical naming burden.

}
}

static int THNN_(view_weight_rowconv)(THTensor **_weight) {
Copy link
Member

Choose a reason for hiding this comment

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

why is this function really needed?
You are defining this module afresh, you can control the exact shape of the weight. Just define the weight shape as you think is appropriate and let's stick to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the function and fixed the weight to a static shape in the Lua interface.

++dimF;
}

THTensor *tinput = THTensor_(newTranspose)(input, dimS, dimF);
Copy link
Member

Choose a reason for hiding this comment

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

the way you wrote this function with all the transposes, it'd be a shame to not also have the function support feature-dimension be 2nd dim optionally (the way it's in pytorch, i.e. Batch x Channels x Width), because when you want to use this in to pytorch, Conv1d's output can be sent directly into this.
Consider adding a boolean flag to the function signature that controls this transposition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It now supports nBatchFrame x inputFrameSize x nInputFrame by supplying an optional fourth argument featFirst = true or by setting module.featFirst = true.

else
stdv = 1 / math.sqrt(self.kW * self.inputFrameSize)
end
if nn.oldseed then
Copy link
Member

Choose a reason for hiding this comment

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

you can remove the oldseed stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@soumith soumith merged commit 8633c28 into torch:master Jan 27, 2017
@soumith
Copy link
Member

soumith commented Jan 27, 2017

thanks! :)

@soumith soumith mentioned this pull request Jan 27, 2017
@willfrey willfrey deleted the rowconv branch January 27, 2017 18:38
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.

None yet

2 participants