@hasanferit @gerasimou
First and foremost, thanks so much for sharing the code! :)
I have a question about method measure_idc when I read the source code.
At the beginning of measure_idc, variable subject_layer(the index of the subject layer from which we get relevant neuron) is reassigned as subject_layer - 1
|
def measure_idc(model, model_name, test_inputs, subject_layer, |
|
relevant_neurons, sel_class, |
|
test_layer_outs, qtized, is_conv, |
|
covered_combinations=()): |
|
|
|
subject_layer = subject_layer - 1 |
|
for test_idx in range(len(test_inputs)): |
Later in method
measure_idc, the new subject_layer is used to get the output of the "subject layer".
|
for r in relevant_neurons: |
|
lout.append(np.mean(test_layer_outs[subject_layer][test_idx][...,r])) |
|
else: |
|
lout = test_layer_outs[subject_layer][test_idx][relevant_neurons] |
It seems that we get the relevant neurons of the subject layer(with index
subject_layer), but we use the outputs of
subject_layer - 1 layer to calculate the idc. That makes me really confused.
Please point out if I misunderstand the code.
I would like to thank you in advance for your time and look forward to hearing from you.
@hasanferit @gerasimou
First and foremost, thanks so much for sharing the code! :)
I have a question about method
measure_idcwhen I read the source code.At the beginning of
measure_idc, variablesubject_layer(the index of the subject layer from which we get relevant neuron) is reassigned assubject_layer - 1deepimportance_code_release/coverages/idc.py
Lines 256 to 262 in 62bea40
Later in method
measure_idc, the new subject_layer is used to get the output of the "subject layer".deepimportance_code_release/coverages/idc.py
Lines 265 to 268 in 62bea40
It seems that we get the relevant neurons of the subject layer(with index
subject_layer), but we use the outputs ofsubject_layer - 1layer to calculate the idc. That makes me really confused.Please point out if I misunderstand the code.
I would like to thank you in advance for your time and look forward to hearing from you.