-
Notifications
You must be signed in to change notification settings - Fork 327
Explain text predictions of Keras classifiers #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
teabolt
wants to merge
159
commits into
TeamHG-Memex:master
Choose a base branch
from
teabolt:keras-gradcam-text
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
159 commits
Select commit
Hold shift + click to select a range
8196243
WeightedSpan commment
teabolt ef63e5a
End-to-end simple text (breaks image)
teabolt 1774ac8
Merge branch 'keras-gradcam-img' of https://github.com/teabolt/eli5 i…
teabolt ccdba2b
Fix image explanations ('regression')
teabolt d94f553
Merge branch 'keras-gradcam-img' of https://github.com/teabolt/eli5 i…
teabolt a7c7e74
New args for text explanations (mypy and docstring)
teabolt efb417b
Move span builder code to function. Add construct_document function
teabolt a2d18d5
Refactor and generalize _validate_doc
teabolt 8dd2579
Refactor _get_activation_layer. Add layer condition for text
teabolt 774b812
Comment about WeightedSpan
teabolt 633dc4c
Disable validation of retrieved activation_layer
teabolt 3dabdd3
Add comment about counterfactual explanations
teabolt d37016c
Add compute_weights to keras package
teabolt b8c979e
Merge branch 'keras-gradcam-img' of https://github.com/teabolt/eli5 i…
teabolt a781e66
Add post-padding removal
teabolt 723e98d
Put text and image explanation code into separate functions
teabolt 3bb13db
Add function to upsize 1D arrays
teabolt d6a23bd
Comment about scipy resample, K.gradients
teabolt 4024be0
Add relu and counterexplanation args
teabolt 30ed0c8
Update lib docs, docstring (heatmap and explanation details)
teabolt b89b65a
Update tests/utils_image.py (use count_nonzero instead of sum)
teabolt 37bfb47
Hardcoding to explain RNN's (with rank 1 activations)
teabolt 049aaca
Merge branch 'keras-gradcam-img' of https://github.com/teabolt/eli5 i…
teabolt 6a4e1ae
Fix failing tests for image explanations
teabolt 74cb56d
Fix mypy for image explanations
teabolt 28c2ac2
Comments
teabolt 1e0bbba
Fix image docs. Run tutorial notebook in update script
teabolt 3beb7ca
Comment about running sections of notebook script
teabolt 58f0108
Make image arg required for image-based explanations
teabolt 379abfc
Update image tutorial to use image arg
teabolt 453b0da
Organise repeated explain_prediction* params
teabolt 37e0337
Remove target_names mentions (moved to GitHub issue)
teabolt d648a80
Update comments and docstring
teabolt e3da435
Rename arg 'estimator' to 'model'
teabolt 5ae57ec
Explanation modifier args. Move heatmap normalization to formatters
teabolt a5baf33
Comments
teabolt 9934265
Support for character-based highlighting
teabolt 597c56f
Fix mypy, add asserts (CI fail)
teabolt 2bce4d4
Refactor lmap calculation. Non-2D layer image formatting.
teabolt 077e2cf
Decouple layer getter and layer search
teabolt 99952c7
Handle pre-padding
teabolt ca345b2
Make span builder use document
teabolt bacb437
Move text methods into keras.text module
teabolt 09df1fc
Fix image tests. Reduce required area percent in test
teabolt 1abca65
Move reusable GradCAM code to a top level gradcam module
teabolt 773c36e
Create neural nets package. Move text and gradcam explanation code to…
teabolt e0e81b3
Fix broken local imports
teabolt e8def57
Add mypy if TYPE_CHECKING comment
teabolt d72491f
Move DESCRIPTION to nn.gradcam
teabolt f3c2be0
Formatting. Separate target prediction auto getter
teabolt 77a2d84
Move tests. Comment TODO's for tests.
teabolt ae9686c
Add integration test setup for text
teabolt 6b8d24c
Take tokens as list or numpy array. Validate
teabolt f900985
Take padding character/value as str or int
teabolt fbd5b3d
Unit tests for nn.text
teabolt c446d85
Improve 1D array resizing method\asdfa
teabolt 508e5f3
Mypy for nn.text. Fix CI
teabolt 121c703
Forgot to rename pad_x to pad_value (ci fix)
teabolt cb354fb
Apply Grad-CAM to layers with single dimension (dense, final rnn, etc)
teabolt bafdc6b
Add mypy annotations
teabolt d7a3e3d
Add text to keras library docs
teabolt 05efdab
Add nn package to docs
teabolt e4530bc
Add integration test for keras binary text classification
teabolt 9bf4ea1
Update docstrings of nn and keras packages
teabolt d2a8724
CI fix: ignore deps, mypy, batching error
teabolt 3fcb46d
Add notebook used to train keras text model
teabolt 59ce1a7
Add tutorial file for keras text
teabolt 3760267
Clean up keras comments, targets validation
teabolt e1f18d6
Move targets validation to nn package
teabolt e2b1928
Add multiclass model in a keras test
teabolt f260e63
Ignore estimator files for nodeps tox envs
teabolt 46214a3
Mypy (fix CI)
teabolt b5e9989
Merge branch 'keras-gradcam-img-v2' of https://github.com/teabolt/eli…
teabolt af4144e
Merge branch 'keras-gradcam-img-v2' of https://github.com/teabolt/eli…
teabolt 61e7f83
Remove _validate_heatmap
teabolt 65736af
Merge branch 'keras-gradcam-img-v2' of https://github.com/teabolt/eli…
teabolt f56697c
Add tokens validation tests
teabolt 6eec249
Explain sentiment classifier in keras text tutorial
teabolt a579cd7
Add multiclass model to tutorial. Add tutorial to docs
teabolt 832490b
Merge branch 'keras-gradcam-img-v2' of https://github.com/teabolt/eli…
teabolt 54b120b
Ignore keras estimator .py files in no deps tests (CI fix)
teabolt 85dc89b
Text tutorial: multiclass explanations, explain_prediction
teabolt 7fa17f3
Improve automatic layer search. Add tests
teabolt 6ccb8cf
Clean up nn.text comments, rename arg.
teabolt 3fa3b01
Explain Grad-CAM formula in keras lib docs
teabolt 2a78ab9
Document interpolation_kind in single docstring, reference in others
teabolt acebfff
Merge branch 'keras-gradcam-img-v2' of https://github.com/teabolt/eli…
teabolt d8d41dc
Merge branch 'keras-gradcam-img-v2' of https://github.com/teabolt/eli…
teabolt 42f8aa0
Add 'return None' statement for mypy (CI fix)
teabolt 843812b
Blank line between :: and code block in docs (CI fix)
teabolt ab6447d
Merge branch 'master' of https://github.com/teabolt/eli5 into keras-g…
teabolt 5d15a49
Test that can take dense/final RNN layers
teabolt a9a9ef3
Add targets validation tests
teabolt 1c123f7
Remove _get_temporal_length. Pass tokens to nn.text without batch
teabolt 9d5370a
Test invalid 'padding' argument
teabolt d545c90
Test invalid heatmap for format_as_image
teabolt d176d0a
Change formatters.image public API (simplify underlying functions). T…
teabolt 49f1a10
Update image tutorial with image API changes and counterfactual/relu …
teabolt fccd266
Add relu and counterfactual integration tests
teabolt 9bd82f1
Mypy updates to image code
teabolt 0dd88ea
Restructure and add to text tutorial
teabolt 0451996
Split parts of _validate_doc() into _validate_doc_shape() (CI fix)
teabolt 30f9708
Add descriptions to text tutorial
teabolt f60a32c
Indentation for long import
teabolt 8599ad9
Wording: accuracy -> score.
teabolt 5930ca4
Apply co-authored commits to .ipynb
teabolt 9ded322
Print python and package versions at runtime for tutorial
teabolt 28a179c
Replace os.getcwd with a working way to reference files in a module
teabolt 71e3d9d
Link to training notebooks in tutorial
teabolt 8c9ae79
Print accuracy clearly for text models
teabolt c1e9cdc
More details on relu and counterfactual in tutorial
teabolt fecaa58
Show padding for dense layer explanation
teabolt 686d810
Remove section on interpolation_kind from tutorial
teabolt 8cd5af9
Add .layer attribute to Explanation
teabolt a32f6ed
Remove own input shape validation and let Keras do it
teabolt 96b07b3
Search for layer backwards by default. Refactor image layer autogetter.
teabolt 2571dc7
Separate pad_value arg into pad_value (number) and pad_token (str)
teabolt 8939929
Remove padding argument and cut pre and post padding automatically
teabolt e188bc6
Update tutorial and tests (not working)
teabolt 8106b27
Fix integration tests by hard-coding to pick embedded layer
teabolt 154333f
Clean up. CI fixes (improve text layer chooser)
teabolt c4a5668
Update tutorial, docs
teabolt 8d5bed0
Add tests, validation (coverage)
teabolt e0d2beb
Misplaced argument (CI fix)
teabolt 0b1e806
Clarify comment for index_from in text model files
teabolt 42ef263
Generalise check for space in tokens
teabolt 6b1c6ed
Update comments, remove TODO's
teabolt 86e7780
Update pad_value docstring
teabolt 3ae37bb
Make layer pickers for text and image raise error if can not find layer
teabolt e705e09
Merge branch 'keras-gradcam-text' of https://github.com/teabolt/eli5 …
teabolt 01c595a
Update docs. Remove _forward_layers
teabolt f1e56da
Mention about spans list in WeightedSpan
teabolt 48f2679
Fix doc type
teabolt bb1ba1e
Update old doc comment
teabolt af821c2
Update text tutorial
teabolt b9a8ca8
Make layer attr take any type. Pass layer instance
teabolt 50b4f6d
Update index docs with text changes
teabolt 7616a4e
Add gradcam test utils. Move tests from integration to unit in Keras
teabolt 69fe751
Rename function. Add tests for package imports
teabolt 9788c22
Move argument validation to relevant modules
teabolt 18980b7
Separate out classification-specific code into a function
teabolt 6cfd526
Replace mypy annotation K.variable with Any
teabolt c94eb52
Add validation for public function arguments
teabolt 6e960ff
Merge branch 'master' of github.com:teabolt/eli5 into keras-gradcam-text
teabolt 881d607
Fix error formatting in eli5.nn.gradcam
teabolt a34bb24
Use multi-backend Keras with TF 1 for tox build
teabolt 646c948
Update TODO's and FIXME's
teabolt 3d2955a
Try to use snap over apt for installing latest cmake
teabolt c52245c
Use classic confinement for snap
teabolt 1f78ea7
Install latest CMake version manually
teabolt cdd45b1
Install using existing CMake
teabolt 2f40e8c
Try to install CMake via shell script
teabolt d790c58
Try to install CMake via pip
teabolt 1f17b2b
Install sciki-learn version that supports python 2.7
teabolt ef876de
Install scikit-learn 0.21
teabolt 6a7eb3d
Update comments and docs
teabolt e6c4981
(Fix install) Install sciki-learn<0.23
teabolt 0009757
Fix up and re-run keras notebooks
teabolt 347ed35
Keras docs: Explain cases where original GradCAM formula isn't followed
teabolt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.