Closed deepakupman closed 8 months ago
Hi Deepak, it looks like the issue is that the package isn't correctly handling held-out features and making predictions with your model. This is one of the core operations when calculating SAGE values, and I wrote the package to work mainly with tabular data where the model input is size (batch, num_features)
. So it's just not currently set up for your use-case, but we should be able to make it work here.
The main thing we need to figure out is the feature imputer. Since you're working with embeddings, it may be simplest to impute held-out feature values with zeros (and this seems reasonable given that you're already training with 1d dropout in the second layer). The package's way of doing this is implemented in the DefaultImputer
class (here), but a couple possible issues jump out to me. First, can I ask which dimensions you want to consider as features? I'm guessing you want the dimension 32 to be features because the 64 dimension looks like the embedding size - is that right? Let me know and I can help write a corrected imputer class.
Also, can I ask what kind of data you're using with a GRU where you want to understand global rather than local feature importance?
I am getting the below error when trying to use it with text data with GRU Layer.
InternalError: Exception encountered when calling layer "gru" (type GRU). Failed to call ThenRnnForward with model config: [rnn_mode, rnn_input_mode, rnn_direction_mode]: 3, 0, 0 , [num_layers, input_size, num_units, dir_count, max_seq_length, batch_size, cell_num_units]: [1, 64, 64, 1, 32, 250000, 0] [Op:CudnnRNN]
Call arguments received: • inputs=tf.Tensor(shape=(250000, 32, 64), dtype=float32) • mask=None • training=False • initial_state=None
Model: Model: "sequential"
Total params: 823,401 Trainable params: 823,401 Non-trainable params: 0