snuspl / dolphin

14 stars 2 forks source link

Pooling layer full implementation #169

Closed ghost closed 8 years ago

ghost commented 8 years ago

This PR includes full implementation for pooling layer. Now PoolingLayerParameterInitializer.java has function that checks the shape of output before being used in calculation. Also, 1D output would be transformed into 2D output for the convenience of calculation. In PoolingLayer.java, concrete codes for feedForwardMaxPooling(), feedForwardAveragePooling(), backPropagateMaxPooling() and backPropagateAveragePooling() are added.

beomyeol commented 8 years ago

@seyounglee95 We should add a unit test for pooling layers.

bgchun commented 8 years ago

+1 for adding tests.

ghost commented 8 years ago

@beomyeol Thank you for your review. I resolved some problem. Please take a look.

beomyeol commented 8 years ago

@seyounglee95 I'll do a pass.

beomyeol commented 8 years ago

@seyounglee95 I finished my pass and left some comments. I also have a concern that IllegalArgumentException will be thrown when users do not specify pooling_type as uppercase. We should convert poolingType to uppercase in the constructor of PoolingLayer before PoolType.valueOf().

beomyeol commented 8 years ago

@seyounglee95 Could you add the description for pooling layers in dolphin-dnn README?

ghost commented 8 years ago

@beomyeol Thank you for your comments. I added the description in README and resolved the problem about the output shape that is not divided by stride. Please take a look.

beomyeol commented 8 years ago

Even though we describe that pooling layers only support 2D input, it will be better to throw an explicit exception indicating that users try to use not supported operation. What do you think of this?

beomyeol commented 8 years ago

@seyounglee95 This looks awesome! I'm merging this. :)