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

Code for Class activation mapping #4

Closed
jhagege opened this issue Nov 6, 2019 · 2 comments
Closed

Code for Class activation mapping #4

jhagege opened this issue Nov 6, 2019 · 2 comments

Comments

@jhagege
Copy link

jhagege commented Nov 6, 2019

Hi, I've been trying to follow the code examples from the class activation mapping workflow (chapter 7) but have a hard time understanding how this code fits with what comes before:

fts = sf[0].features[idx]
        prob = np.exp(to_np(log_prob))
        preds = np.argmax(prob[idx])
        fts_np = to_np(fts)
        f2=np.dot(np.rollaxis(fts_np,0,3), prob[idx])
        f2-=f2.min()
        f2/=f2.max()
        f2
plt.imshow(dx)
plt.imshow(scipy.misc.imresize(f2, dx.shape), alpha=0.5, cmap='jet');

Could you please post the code that is consistent with previous naming, or add a file in the repository to demonstrate this flow ?

Thanks !

@falloutdurham
Copy link
Owner

Added!

@jhagege
Copy link
Author

jhagege commented Nov 11, 2019

Great, thanks :)

@jhagege jhagege closed this as completed Nov 11, 2019
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