-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
XAI with Saliency library solution notebook #426
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
View / edit / reply to this conversation on ReviewNB sanjanalreddy commented on 2024-03-25T22:06:05Z Can you add a line about what the Saliency library does? takumiohym commented on 2024-03-27T16:43:21Z Makes sense! Added. |
View / edit / reply to this conversation on ReviewNB sanjanalreddy commented on 2024-03-25T22:06:06Z Can you please break these functions up into multiple cells and provide an explanation of what each function does? takumiohym commented on 2024-03-27T16:50:50Z Actually this cell and description is taken by the vertex ai explanation notebook.
I think we can assume the user understand this basic flows as the vertex ai version assumes in this notebook, since it is not the focus.
Anyway I added a reference to another notebook in case students want to review what's going on here. I hope it helps! BenoitDherin commented on 2024-03-28T16:08:55Z I agree with Sanjana. Breaking that long code cell and adding one-liner explanations in markdown will help a lot. takumiohym commented on 2024-04-02T19:50:51Z Broke up to multiple cells, and removed unnecessary functions. |
View / edit / reply to this conversation on ReviewNB sanjanalreddy commented on 2024-03-25T22:06:07Z Line #36. "https://tfhub.dev/google/imagenet/" tfhub.dev is going to be deprecated soon, can you use the Kaggle Models link here instead? takumiohym commented on 2024-03-27T16:53:35Z Makes sense! Updated. BenoitDherin commented on 2024-03-28T16:12:53Z Please store the long URL into a separate variable at the beginning of the cell. It seems to me some of the lines have more than 80 chars (pep8 violation). Maybe pass it through a pep8 formatter. takumiohym commented on 2024-04-02T19:51:11Z Modified. Thanks! |
View / edit / reply to this conversation on ReviewNB sanjanalreddy commented on 2024-03-25T22:06:07Z Can you add a brief explanation of Integrated Gradients here? takumiohym commented on 2024-03-27T16:57:38Z Added. Thanks! |
View / edit / reply to this conversation on ReviewNB sanjanalreddy commented on 2024-03-25T22:07:11Z Very nice! Thank you for adding this notebook! takumiohym commented on 2024-03-27T16:57:50Z Thank you for your feedback! |
Makes sense! Added. View entire conversation on ReviewNB |
Actually this cell and description is taken by the vertex ai explanation notebook.
I think we can assume the user understand this basic flows as the vertex ai version assumes in this notebook, since it is not the focus.
Anyway I added a reference to another notebook in case students want to review what's going on here. I hope it helps! View entire conversation on ReviewNB |
Makes sense! Updated. View entire conversation on ReviewNB |
Added. Thanks! View entire conversation on ReviewNB |
Thank you for your feedback! View entire conversation on ReviewNB |
I agree with Sanjana. Breaking that long code cell and adding one-liner explanations in markdown will help a lot. View entire conversation on ReviewNB |
Please store the long URL into a separate variable at the beginning of the cell. It seems to me some of the lines have more than 80 chars (pep8 violation). Maybe pass it through a pep8 formatter. View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:15Z
takumiohym commented on 2024-04-02T19:49:46Z Modified. Thanks! |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:16Z * Use "os.path.join" instead of concatenating with "+" (this will avoid issues with "//" or no "/" ) takumiohym commented on 2024-04-02T19:49:55Z Modified. Thanks! |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:16Z This is a long code cell. Maybe break it so that you can explain what the functions are doing in markdown cells above the code cells. takumiohym commented on 2024-04-02T19:50:42Z Broke up to multiple cells, and removed unnecessary functions. |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:17Z Punctuation: "Now that our image classification model has been trained, let's choose a target image we want to explain, and check the prediction result."
takumiohym commented on 2024-04-02T19:51:24Z Modified. |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:18Z Please break this cell into one code cell per function and explain what these functions are doing in a markdown cell. takumiohym commented on 2024-04-02T19:52:02Z Removed these helper functions. Integrated all to a single |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:19Z
takumiohym commented on 2024-04-02T19:52:49Z Rewrote this section by adding detailed explanations. |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:19Z
takumiohym commented on 2024-04-02T19:53:19Z Modified, and adde explanations on the saliency methods and masks. |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:22Z
takumiohym commented on 2024-04-02T19:56:23Z Added comprehensive explanations. |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:22Z
takumiohym commented on 2024-04-02T19:56:56Z Expanded the entire XRAI explanations. |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-03-28T16:41:23Z Add licence information. takumiohym commented on 2024-04-02T19:57:06Z Added. Thanks! |
Modified. Thanks! View entire conversation on ReviewNB |
Modified. Thanks! View entire conversation on ReviewNB |
Broke up to multiple cells, and removed unnecessary functions. View entire conversation on ReviewNB |
Broke up to multiple cells, and removed unnecessary functions. View entire conversation on ReviewNB |
Modified. Thanks! View entire conversation on ReviewNB |
Modified. View entire conversation on ReviewNB |
Removed these helper functions. Integrated all to a single View entire conversation on ReviewNB |
Rewrote this section by adding detailed explanations. View entire conversation on ReviewNB |
Modified, and adde explanations on the saliency methods and masks. View entire conversation on ReviewNB |
Added explanations!
Regarding the function argument, this is what the Saliency library expects and can't be modified. I think it's ok given this function is used not for generic purpose, but as a model wrapper to define an extra function for saliency methods. View entire conversation on ReviewNB |
Added those informations. Thanks! View entire conversation on ReviewNB |
Added comprehensive explanations. View entire conversation on ReviewNB |
Expanded the entire XRAI explanations. View entire conversation on ReviewNB |
Added. Thanks! View entire conversation on ReviewNB |
Thanks! Great! View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-04-02T20:24:40Z
takumiohym commented on 2024-04-03T10:03:38Z Modified. Thanks! |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-04-02T20:24:41Z Some typos fixed in the suggestion below:
"The code in the cell below contains the training logic. It starts by ingesting the data from GCS, then trains an image classification model using mobileNet as a feature extractor, and at last sends its output feature vector through a tf.keras.dense layer with 5 units (one unit per label) and a softmax activation ." takumiohym commented on 2024-04-03T10:03:58Z Modified. Thanks! |
View / edit / reply to this conversation on ReviewNB BenoitDherin commented on 2024-04-02T20:24:43Z Something is off with the bullet points here. They don't seem to be matching the steps. takumiohym commented on 2024-04-03T10:06:17Z It seem it is a bug of this reviewer app. The original markdown was ok. (2. should come before "Compute gradients...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Modified. Thanks! View entire conversation on ReviewNB |
Modified. Thanks! View entire conversation on ReviewNB |
It seem it is a bug of this reviewer app. The original markdown was ok. (2. should come before "Compute gradients...") View entire conversation on ReviewNB |
A new notebook for XAI with Saliency library. This notebook trains and explains a image classification model locally.