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

Switched Pooling #2

Closed
mpariente opened this issue Mar 9, 2017 · 6 comments
Closed

Switched Pooling #2

mpariente opened this issue Mar 9, 2017 · 6 comments

Comments

@mpariente
Copy link

Hi keunwoochoi, thank for this tool it works great on your network! :)

I wonder how I can get this tool to work with a network that I will define and train myself :

  • get_unpooling2d(images, switches, ds=2) takes the argument switches, I guess it's from a custom MaxPooling2D function, am I right? If not, which function did you use in your CNN and where can I find it?

  • Is the code generic and can easily generalize to other CNN architecture? Some functions look quite specific ( load_weights() for example, but could be easy to change)

  • What is the structure of the file .keras? Is it enough if I save a model in the HDF5 format?

Thank you in advance :)

PS : If you could give a concrete example on how to use it with another model it would be so great but I would understand if you don't want to reveal your custom function.

@keunwoochoi
Copy link
Owner

.keras

It is just a hdf file (with a strange extension name ;) ) with weights by using save_weights() method of keras model. There are more than one way to save keras model/weights though.

is the code generic

I don't think so. But there should be an easier way to do this, because when I did it there was no unpooling method in Keras.

custom mp2d function

this is the custom mp function. So in this auralisation stage, all the computation is done on cpu (therefore quite slow).

@mpariente
Copy link
Author

Thanks for the answer !
I'll try the method with one of my own networks and let you know :)

@mpariente
Copy link
Author

I had to make some adjustments but now it works.
(I guess you didn't simply use the function save_weights to save the model)

I have another question : is it suppose to work for both border_mode='valid' or border_mode='same' ?

@keunwoochoi
Copy link
Owner

keunwoochoi commented Mar 15, 2017

(I guess you didn't simply use the function save_weights to save the model)

Ah.. really? Keras version was 0.3 or something back then, maybe that's why.

I think it shouldn't matter if it's valid or same. Haven't tried it though.

@mpariente
Copy link
Author

The function load_weights in auralise.py didn't work on the model I saved so I loaded the weights and layer names differently.

It should work with both border_mode but in your deconvolution code you presuppose same to get the same size right?

@keunwoochoi
Copy link
Owner

Oh, I see. Sorry, I was answering while relying on what I remember and not on the code. The load_weights, as you might already realised, is a custom function for my network.

And yes, I assumed it's same convolution.

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

2 participants