Open NooneBug opened 2 years ago
Hi Manuel! Thanks for the feedback. I checked the code at line 98 and tried it in debug mode. The behavior seems correct to me. The correct matrix, used by the knowledge enhancer, is scattered_delta which contains the changes to be applied on the initial predicates. The delta matrix was used in the tensorflow version for explainability (but the code of the explainer is not available for the pytorch version, and not yet completed in the tensorflow one). It was copied from the tensorflow code while doing the migration but it can be removed.
Hi,
I found a strange behavior of the code. After solving the other issue I posted as explained inside the issue, I used the code to see the
deltas
returned by theKnowledgeEnhancer
(as you can see in the notebook).I found that if I manually sum the returned
deltas
with the original preactivation I obtain a different vector w.r.t. the one returned by theKnowledgeEnhancer
. I used the debugger to inspect the behavior and I found that in line98
ofClauseEnhancer.py
the variablesscattered_delta
anddelta
contain the same values but reversed. I also checked thatscattered_delta
is the summed variable to obtain the enhanced prediction anddelta
is the returned variable whensave_training_data = True
.Why these variables are reversed?
I think that the correct one is
scattered_delta
, is it correct?Thanks