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

Null valued output and not saving variable? #53

Open
jaschil2 opened this issue Jan 13, 2020 · 0 comments
Open

Null valued output and not saving variable? #53

jaschil2 opened this issue Jan 13, 2020 · 0 comments

Comments

@jaschil2
Copy link

I have the following code:

with DeepExplain(session=K.get_session()) as de:
    model_path = os.path.join(os.getcwd(),'N58_1','FOLD_00','model_E099_0.897.hdf5')
    model = load_model(model_path)
    flat = Reshape(target_shape=(256*256,))(model.layers[-1].output)
    flat_model = Model(model.layers[0].input,flat)

    input_tensor = flat_model.layers[0].input
    target_tensor = flat_model(input_tensor)
    
    xs = images[0][np.newaxis,...]
    ys = np.zeros(256**2)
    ys = ys[np.newaxis,...]
    ys[0,15678] = 1

    attributions_oc = de.explain('occlusion',target_tensor,input_tensor,xs,window_shape=(32,32,1),step=16)

Basically, I have an encoder-decoder neural network and I want to see if I can determine feature importances for particular output pixels. However, when I run this code,

  • The output is all zero (I tried plotting it in the session context)
  • And attributions_oc does not appear to exist. That is, it is not accessible in my jupyter notebook.

Yet, I have no errors. I am wondering what I am doing wrong?

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