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

Add ImageExpandFunction. #2449

Merged
merged 23 commits into from
Jul 25, 2017
Merged

Conversation

hedaoyuan
Copy link
Contributor

@hedaoyuan hedaoyuan commented Jun 12, 2017

Fix #2424. Need pr #2282 .

number old code new code about
1 BlockExpandLayer ImageExpand, ImageExpandGrad, BlockExpandLayer Use the ImageExpand and ImageExpandGrad function to refactor the code of BlockExpandLayer.
2 Im2ColFunctor, Col2ImFunctor in pr #2282 Im2ColFunctor, Col2ImFunctor Use the TensorShape to refactor the arguments of the Im2ColFunctor and Col2ImFunctor interfaces. And add ColFormat kOCF.
3 Unit test of Im2ColFunctor, Col2ImFunctor The transposition of the result of ColFormat==kCFO is equal to the result of ColFormat==kOCF.
4 Remove Matrix::convExpand and Matrix::convShrink after pr #2282

namespace paddle {

/* The storage format of the coldata in the Im2ColFunctor and Col2ImFunctor. */
enum ColFormat { kCFO = 0, kOCF = 1 };
Copy link
Contributor

Choose a reason for hiding this comment

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

这两种格式在Layer里都用嘛? 我印象中只用了一种吧。 有两种的话,会导致weight是转置关系吗?

C: input channel
F: filter
O: output channel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kCFO是用在GemmConvFunction卷积计算中的kOCF是用在这个PR的BlockExpandFunction中的,原先BlockExpandLayer中是用的kCFO这种方式,不过计算完了,还需要再做一次转置才行。

@qingqing01
Copy link
Contributor

Almost LGTM.

@hedaoyuan hedaoyuan merged commit 1ab2e44 into PaddlePaddle:develop Jul 25, 2017
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