Changed activation function applied to output logits in class MultiLabelClassificationExplainer. Is now using sigmoid.
Added a class MultiClassClassificationExplainer that uses softmax on output logits like MultiLabelClassificationExplainer used to do.
Sorting of labels is done according to the label index instead of default sorting.
Motivation and Context
the multi-label class MultiLabelClassificationExplainer should be implemented with sigmoid instead of softmax on the output.
To keep the multi-class functionality, a new class MultiClassClassificationExplainer is created.
(which might cause issues/confusion for existing users)
I also made a minor change to the ordering of labels (as i think theres a bug with these too). I believe the ordering of the labels should follow the ids in the label2id dict. without sorting based on the id, the labels are swapped in the output html file generated with the visualize() function
References issue: #107
Tests and Coverage
Instantiated and vizualised MultiLabelClassificationExplainer and MultiClassClassificationExplainer and verified HTML output.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Docs (Added to or improved Transformers Interpret's documentation)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Final Checklist:
[ ] My code follows the code style of this project.
Changed activation function applied to output logits in class
MultiLabelClassificationExplainer
. Is now using sigmoid. Added a classMultiClassClassificationExplainer
that uses softmax on output logits likeMultiLabelClassificationExplainer
used to do.Sorting of labels is done according to the label index instead of default sorting.
Motivation and Context
the multi-label class
MultiLabelClassificationExplainer
should be implemented with sigmoid instead of softmax on the output.To keep the multi-class functionality, a new class
MultiClassClassificationExplainer
is created. (which might cause issues/confusion for existing users)I also made a minor change to the ordering of labels (as i think theres a bug with these too). I believe the ordering of the labels should follow the ids in the label2id dict. without sorting based on the id, the labels are swapped in the output html file generated with the visualize() function References issue: #107
Tests and Coverage
Instantiated and vizualised
MultiLabelClassificationExplainer
andMultiClassClassificationExplainer
and verified HTML output.Types of changes
Final Checklist: