You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the saliency method applied to Autoencoders and reconstruction errors.
Also, I do not have images, but a feature array for each observation.
My goal is to check the "importance" of each input feature to the overall reconstruction, thus was trying to use smoothgrad method.
In this case, I do not understand what should I pass to 'score'. The output of the model is just the reconstructed input (n_samples x n_features).
I also couldn't pass a custom function to the score attribute as you suggest in the documentation.
'From the example in the repository:
Instead of using CategoricalScore object,
you can also define the function from scratch as follows:
def score_function(output):
# The output variable refers to the output of the model,
# so, in this case, output shape is (3, 1000) i.e., (samples, classes).
return (output[0][1], output[1][294], output[2][413])
,
But then, how can you pass the function to the method? It needs to be callable, so it gives "ValueError: Score object must be callable! "
Could you add an example explicitly using score_function passed to saliency() (or any other) instance, instead of the instance score from one of the defined score classes (BinaryScore, CategoricalScore) ?
Thank you in advance!
The text was updated successfully, but these errors were encountered:
Hi, @inesws, did you manage to figure out a custom score function for the autoencoder? I'm facing the same problem right now and so far no luck solving it...
Hi! Thanks for this XAI visualization package!
I am trying to use the saliency method applied to Autoencoders and reconstruction errors.
Also, I do not have images, but a feature array for each observation.
My goal is to check the "importance" of each input feature to the overall reconstruction, thus was trying to use smoothgrad method.
In this case, I do not understand what should I pass to 'score'. The output of the model is just the reconstructed input (n_samples x n_features).
I also couldn't pass a custom function to the score attribute as you suggest in the documentation.
'From the example in the repository:
Instead of using CategoricalScore object,
you can also define the function from scratch as follows:
def score_function(output):
# The
output
variable refers to the output of the model,# so, in this case,
output
shape is(3, 1000)
i.e., (samples, classes).return (output[0][1], output[1][294], output[2][413])
,
But then, how can you pass the function to the method? It needs to be callable, so it gives "ValueError: Score object must be callable! "
Could you add an example explicitly using score_function passed to saliency() (or any other) instance, instead of the instance score from one of the defined score classes (BinaryScore, CategoricalScore) ?
Thank you in advance!
The text was updated successfully, but these errors were encountered: