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

Printing weighting frame #5

Open
MNstudent opened this issue Jun 5, 2018 · 1 comment
Open

Printing weighting frame #5

MNstudent opened this issue Jun 5, 2018 · 1 comment

Comments

@MNstudent
Copy link

Hello,

Your paper was an interesting read and thank you for making available the code. After following example.ipynb, I was wondering how I can print/visualize the weightings of the different 'candidate predictors'. It should be the case that B and D have high weightings for target variable E since E is a sum of last 10 values of B multiplied by D.
Which variable in SOCNN.py is the weighting frame? And do you have any suggestions what the best way is to print this?

Thank you in advance

@mbinkowski
Copy link
Owner

mbinkowski commented Jun 13, 2018

Hi, thanks for your interest in the paper.

To visualize the significance weights and offsets, you need to construct a keras function that recovers the proper part of the computational graph. significance weights are obtained as the output from 'softmax' layer, while offsets from 'offset1act' layer. The code may go as follows

significance_output = K.function([nn.layers[0].input, K.learning_phase()], [[l for l in nn.layers if l.name == 'softmax'][0].output])
offset_output = K.function([nn.layers[0].input, K.learning_phase()], [[l for l in nn.layers if l.name == 'offset1act'][0].output])

Where nn is the keras model of the network (stored by default in hdf5 files).

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