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

Possibility to ignore the reconstruction/decoder? #81

Closed
fastesol opened this issue Oct 26, 2018 · 4 comments
Closed

Possibility to ignore the reconstruction/decoder? #81

fastesol opened this issue Oct 26, 2018 · 4 comments

Comments

@fastesol
Copy link

fastesol commented Oct 26, 2018

I think, reconstruction/decoder is not much helpful in learning the model, but creating an extra computation overhead. So, in order to prove this hypothesis/thought (or whatever you call it), is it possible to remove the decoder part?
This is what I tried so far.

out_caps = Length(name='capsnet')(digitcaps)
train_model = models.Model([x, y], out_caps)

but getting the following error

ValueError: When passing a list as loss, it should have one entry per model outputs. The model has 1 outputs, but you passed loss=[<function margin_loss at 0x7f2f44f06ea0>, 'mse']

I'm sure, I'm doing it wrong way, probably have to reshape the out_caps to something else. Please help.

Thank you!

@fastesol fastesol changed the title Possibility to ignore the decoder? Possibility to ignore the reconstruction/decoder? Oct 26, 2018
@JoyJulianGomes
Copy link

Hi @fastesol if you want to get rid of decoder/reconstruction, you should also exclude the loss function it is using which is 'mse'

@fastesol
Copy link
Author

Thank you @JoyJulianGomes can you instruct the required changes in the code please? Sorry I’m new to this field.

@JoyJulianGomes
Copy link

@fastesol as you are new to this, working out the problem yourself would be better for the long run than just telling you what to change. I can give you some hints but you have to do it yourself.

  1. you will not need the decoder part, use up to the layer 4.
  2. checkout how keras Model works https://keras.io/models/model/ and change the inputs accordingly.

P.S.: I am new to this as well

@XifengGuo
Copy link
Owner

@muaaz-khalid You can just set the parameter lam_recon=0 to prove your hypothesis.

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