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

Can i Implement a custom pooling function #7045

Closed
beebrain opened this issue Jun 19, 2017 · 3 comments
Closed

Can i Implement a custom pooling function #7045

beebrain opened this issue Jun 19, 2017 · 3 comments

Comments

@beebrain
Copy link

I implement a convolution neural network on Keras with Theano backend. And I want to change pooling function to RMS (Root Mean Square) function.

How to change a pooling function to custom function?

@td2014
Copy link
Contributor

td2014 commented Jun 20, 2017

Hi. If this is just for your own use, I can suggest the following: Make a copy of the "pooling.py" file in your local python directory, and rename it to something like "custom_pooling.py" . It will have all the needed module imports - check in this link: https://github.com/fchollet/keras/tree/master/keras/layers
Then, select the pooling class that is closest to what you want to implement and rename it to
"class RMS_Pooling1D(Layer):" etc. When you are ready, just import this class like any other layer. I created my own layer in a similar way. I hope this helps. Thanks.

@stale stale bot added the stale label Sep 18, 2017
@stale
Copy link

stale bot commented Sep 18, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

@stale stale bot closed this as completed Oct 18, 2017
@EliasHasle
Copy link

Maybe I misunderstand, but can't RMS pooling be implemented as square -> avg. pool -> sqrt ?

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

No branches or pull requests

3 participants