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

Extracting dynamic routing parameters of trained model #93

Closed
canyalniz opened this issue Jul 27, 2019 · 1 comment
Closed

Extracting dynamic routing parameters of trained model #93

canyalniz opened this issue Jul 27, 2019 · 1 comment

Comments

@canyalniz
Copy link

First of all I would like to thank you for creating such a great resource. I am fairly new to machine learning so sorry if this is an obvious question.

I am trying to extract parameters from a trained model using this code:

weights = []
config = []
for layer in model.layers:
    weights.append(layer.get_weights())
    config.append(layer.get_config())

Conv1_weights = weights[1][0]
Conv1_biases = weights[1][1]

PrimaryCaps_weights = weights[2][0]
PrimaryCaps_biases = weights[2][1]

DigitCaps_weights = weights[5][0]

My question is, how can I get the b and c values used during dynamic routing?

@canyalniz
Copy link
Author

I now realize that initially I falsely thought the coupling coefficients were determined during training as well. However I realized that even during inference the model goes through the dynamic routing process to rediscover the coupling coefficients for each new sample.

This is discussed in issue #28 as well.

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

1 participant