Skip to content

Conversation

vivekmig
Copy link
Contributor

Adding tutorial for Captum based on the Titanic survival dataset. This tutorial reviews applying IG, Conductance and Neuron Conductance to a small model, demonstrating the different types of attributions possible using Captum. A few other small changes are included such as renaming Conductance to LayerConductance to make the distinction between LayerConductance and NeuronConductance clear as well as updating the default number of steps in conductance to 50 to match IG.

Copy link
Contributor

@NarineK NarineK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks awesome! Thank you @vivekmig !

Couple comments:

  1. What do you mean by the comment : # Linear 0 is simply identity transform did you mean linear1?
  2. Also, I don't see relu-s in the forward function but there are some relu_out1 and relu_out2 variables.
  3. Sigmoid is a little unusual did you mean Relu ?
  4. It looks like the printouts for the training are very lengthy. Perhaps we could printout some of the epochs using an interval - after running for, let's say, each xx epochs, similar to CIFAR ?
  5. nit: "how it reaches it's decision," -> "... its decision" ?
  6. nit: "requiresgrad" -> requires_grad_ ?
  7. Did you also try to compare with random forest's or the linear model's feature importance ?
  8. Also, it would be interesting to compare the importances of different layers

@vivekmig
Copy link
Contributor Author

Thanks for the feedback!

  1. Whoops, this was left over from copying one of the test models, removed it now, thanks!

  2. I was trying different models and switched ReLU to Sigmoid at some point and it was slightly better. Missed renaming the variable, so fixed that now, thanks!

  3. Yeah, ReLU is more common, but Sigmoid did slightly better. I think it doesn't really affect the tutorial much either way, and I would need to update the later analysis if the network changes, so I'd prefer to leave it to Sigmoid.

  4. Good point, I've updated to only print every 20 epochs now.

  5. Fixed, thanks!

  6. Seems like this was markdown interpreting underscore for italics, fixed this now, thanks!

  7. So I did try with logistic regression initially and originally had the tutorial starting with the logistic regression model and then developing to the NN models. Overall the importances are pretty similar, but the issue with that was that the age coefficient looked artificially very small, because the range was much larger. I could've normalized the variables initially, but it was also nice to have the 0/1 significance for binary variables. Also, the normalization isn't really necessary for IG, so I didn't want to make it more confusing than necessary. I finally decided that the tutorial was reasonably long already and the logistic regression didn't seem to add much value to conveying the usage / importance of Captum (and may actually make it a little more confusing), so I ended up removing it. If you think it would be valuable to add back, lmk, I can add it!

  8. How do we define the importance of a layer / compare across layers? I could do an analysis of the second layer as well, but I figured the first layer might be sufficient to show the usage.

@NarineK
Copy link
Contributor

NarineK commented Aug 29, 2019

Thank you, Vivek!
7. For the comparison, we can think later creating separate notebook. Titanic DS is usually analyzed with traditional ML Algorithms. I was thinking that showing what those models learn differently and what features does one model focuses on vs the other, would be useful.
8. I was thinking of comparing the importances of those layers (e.g. comparing the sum of importances of the layers and the distribution of importances). E.g. if second layer looks exactly the same as the first one - is it more important ? This will make sense with more layers and would probably have more scientific focus rather than "how to use captum".

It looks good for showcasing how to use captum.

Copy link
Contributor

@orionr orionr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Some nits, but approving regardless.

"\n",
"import torch\n",
"\n",
"from captum.attributions.integrated_gradients import IntegratedGradients\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change this to from captum.attr import IntegratedGradients and same for the rest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks!

"cell_type": "markdown",
"metadata": {},
"source": [
"We will begin by importing and cleaning the dataset. Download the dataset from http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic3.csv and update the cell below with the path to the dataset csv."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to use some PyTorch dataset downloading mechanism to do this automatically for the user? Not 100% sure, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, will look into it.

"cell_type": "markdown",
"metadata": {},
"source": [
"With the data loaded, we now preprocess the data by converting some categorical features such as gender, location of embarcation, and passenger class into one-hot encodings (separate feature columns for each class with 0 / 1). We also remove some features that are more difficult to analyze such as name, and fill missing values in age and fare with the average values."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: difficult to analyze such as name, and fill missing values -> difficult to analyze, such as name, and fill missing values

"cell_type": "markdown",
"metadata": {},
"source": [
"After processing the features we now have are:\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: After processing the features we now have are: -> After processing the features we have are:

"* Sibsp - Number of Siblings / Spouses Aboard\n",
"* Parch - Number of Parents / Children Aboard\n",
"* Fare - Fare Amount Paid in British Pounds\n",
"* Female - Binary varible indicating whether passenger is female\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: varible -> variable and on the other lines too

}
],
"source": [
"bin_means, bin_edges, binnumber = stats.binned_statistic(test_features[:,1], attr[:,1], statistic='mean', bins=6)\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIt: Doesn't look like you use binnumber - can it just be _?

"cell_type": "markdown",
"metadata": {},
"source": [
"We can now obtain the conductance values for all the test examples by calling attribute on the Conductance object. Conductance also requires a target index for networks with mutliple outputs, defining the index of the output for which gradients are computed. Similar to feature attributions, we provide target = 1, corresponding to survival. Conductance also utilizes a baseline, but we simply use the default zero baseline as in integrated gradients."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - change Conductance to LayerConductance here?

},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAGDCAYAAADtZ0xmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3de7xdZX3n8c9XIniplksChGusUhU7Ndoj2Fqpw0WwWEOdqlBHU6tl7GitrbbiZdRa6YSxrdqOtkUUouIVtVBtFYii1hE02CAgYhCCRAJELoraouhv/thP6vZ4Tk6e7JPsc46f9+u1Xnut9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wbja49Or6utJ7gd8AH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - neuron attributions to Neuron Attributions?

},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAGDCAYAAADtZ0xmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3de7xdZX3n8c9XIniplksChGusUhU7Ndoj2Fqpw0WwWEOdqlBHU6tl7GitrbbiZdRa6YSxrdqOtkUUouIVtVBtFYii1hE02CAgYhCCRAJELoraouhv/thP6vZ4Tk6e7JPsc46f9+u1Xnut9Txrrd9zdpLzzdrP3jtVhSRJkqRtd49xFyBJkiTNN4ZoSZIkqZMhWpIkSepkiJYkSZI6GaIlSZKkToZoSZIkqZMhWpIkSepkiJY05yS5KMntSXYbdy2zoY3nP5IcOLTv6CQbxljWNkmyLEklWTTuWgBaLQ8adx2SZIiWNKckWQY8FijgSTvoGuMIhN8B/teOvshcCbuzbaGOS9L8ZYiWNNc8E7gYOAtYuWVnkkcnuSnJLkP7fjPJF9v6PZKckuSrSW5N8r4ke7a2LXdTn53ka8DH2/73t3N+M8mnkjxs6Nx7JfmnJN9K8vkkr03yr0PtD0lyQZLbklyd5KkzjOtvgJOmu4uaZL8kH0iyOcl1SV4w1HZWktcObT8uycah7Q1JXtJ+Ft9JsijJQ9sd8DuSXJnkSZPO96YkH0lyZ5JLkjxwhvqHj31zkn9J8u0kn0myb5I3tFcPvpzkEZNqe2mSL7X2M5Pca6j995Jc036O5yXZb6itkjwvyXpgfZJPtabL2rWflmSPJB9uP7fb2/oBQ+e4KMmftzrvTHJ+ksVD7b+a5P+1n9MNSX6n7d8tyV8m+VqSm5P8fZJ7t7bF7Tp3tLo/ncTfp9JPGf/SS5prngmc3ZZjk+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yRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUyRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUyRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUadG4C9D4bFh1/LhLkCRJmpe8Ey1JkiR1MkRLkiRJnQzRkiRJUidDtCRJktTJEC1JkiR1MkRLkiRJnUYK0Un2THJBkvXtcY9p+q1sfdYnWTm0/6IkVydZ15a9R6lHkiRJ2hlGvRN9CrCmqg4B1rTtH5NkT+BVwOHAYcCrJoXtp1fV8rbcMmI9kiRJ0g43aoheAaxu66uBE6bocyxwQVXdVlW3AxcAx414XUmSJGlsRg3R+1TVJoD2ONV0jP2BG4a2N7Z9W5zZpnL8rySZ7kJJTk6yNsnazZs3j1i2JEmStP1m/NrvJBcC+07R9PJtvMZUwbja49Or6utJ7gd8AH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - Conductance to LayerConductance

},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtEAAAGDCAYAAADtZ0xmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3de7xdZX3n8c9XIniplksChGusUhU7Ndoj2Fqpw0WwWEOdqlBHU6tl7GitrbbiZdRa6YSxrdqOtkUUouIVtVBtFYii1hE02CAgYhCCRAJELoraouhv/thP6vZ4Tk6e7JPsc46f9+u1Xnut9Txrrd9zdpLzzdrP3jtVhSRJkqRtd49xFyBJkiTNN4ZoSZIkqZMhWpIkSepkiJYkSZI6GaIlSZKkToZoSZIkqZMhWpIkSepkiJY05yS5KMntSXYbdy2zoY3nP5IcOLTv6CQbxljWNkmyLEklWTTuWgBaLQ8adx2SZIiWNKckWQY8FijgSTvoGuMIhN8B/teOvshcCbuz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jBzurTgdOB5iYmJiyjyRJmpsMalpoZmM6x0bgwKHtA4Abp+uTZBHws8Bt23isJEmSNKfMRoj+PHBIkgck2ZXBGwXPm9TnPGBlW/8t4ONVVW3/ie3TOx4AHAJ8bhZqkiRJknaYkadztDnOzwc+BuwCvK2qrkzyGmBtVZ0HvBV4R5JrGNyBPrEde2WS9wFfAu4GnldVPxi1JkmSJGlHmpVvLKyqfwb+edK+Vw6t/wfwlGmOPRU4dTbqkCRJknYGv7FQkiRJ6mSIliRJkjoZoiVJkqROhmhJkiSpkyFakiRJ6mSIliRJkjoZoiVJkqROhmhJkiSpkyFakiRJ6mSIliRJkjoZoiVJkqROhmhJkiSp06JxFyBp4duw6vhxlyBJ0qzyTrQkSZLUyRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUyRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUyRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUyRAtSZIkdTJES5IkSZ0M0ZIkSVInQ7QkSZLUadG4C9D4bFh1/LhLkCRJmpe8Ey1JkiR1MkRLkiRJnQzRkiRJUidDtCRJktTJEC1JkiR1MkRLkiRJnUYK0Un2THJBkvXtcY9p+q1sfdYnWTm0/6IkVydZ15a9R6lHkiRJ2hlGvRN9CrCmqg4B1rTtH5NkT+BVwOHAYcCrJoXtp1fV8rbcMmI9kiRJ0g43aoheAaxu66uBE6bocyxwQVXdVlW3AxcAx414XUmSJGlsRg3R+1TVJoD2ONV0jP2BG4a2N7Z9W5zZpnL8rySZ7kJJTk6yNsnazZs3j1i2JEmStP1m/NrvJBcC+07R9PJtvMZUwbja49Or6utJ7gd8AH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - substantiallly -> substantially

@vivekmig
Copy link
Contributor Author

Makes sense, thanks @NarineK!
7. Yes it would be interesting to do a detailed comparison between NNs and feature attribution for simpler models!
8. For conductance, I think we're guaranteed that every layer has the same sum? But this could work for other methods, and looking at the distribution for larger models would be interesting! Will look into it more and see.

Thanks for the review @orionr! Had quite a few typos, thanks for catching them!

@vivekmig vivekmig merged commit 17a6dec into meta-pytorch:master Aug 29, 2019
orionr pushed a commit that referenced this pull request Sep 20, 2019
vivekmig pushed a commit that referenced this pull request Oct 9, 2019
NarineK pushed a commit to NarineK/captum-1 that referenced this pull request Nov 19, 2020
@bilalsal bilalsal mentioned this pull request May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants