"/usr/local/lib/python2.7/site-packages/sklearn/utils/validation.py:444: DataConversionWarning: Data with input dtype int64 was converted to float64 by StandardScaler.\n",
"/usr/local/lib/python2.7/site-packages/torch/nn/functional.py:767: UserWarning: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([64, 1])) is deprecated. Please ensure they have the same size.\n",
" \"Please ensure they have the same size.\".format(target.size(), input.size()))\n",
"/usr/local/lib/python2.7/site-packages/torch/nn/functional.py:767: UserWarning: Using a target size (torch.Size([13])) that is different to the input size (torch.Size([13, 1])) is deprecated. Please ensure they have the same size.\n",
" \"Please ensure they have the same size.\".format(target.size(), input.size()))\n"
"**IMPORTANT NOTE**: embedding layers require `LongTensors` as inputs (so you can do the embedding look-up). In this case, we combine the embeddings inputs (workclass, education, etc...) with `age` and `hours per week`. These are integers and can be passed as `LongTensors` and transformed later to `float` (so they can be concatenated with the dense embeddings). If you wanted to combine float features with the embedding inputs, there are 2 simple changes of the code you would have to made: \n",
"\n",
"1. Adapt the `prepare_data` function so that the it returns a dictionary where the datasets would have to include: `(X_wide, X_embedding, X_continuous, y_train)` as oppopsed to `(X_wide, X_embedding, y_train)` as they do now.\n",
"\n",
"2. The `forward` method should receive two inputs and be adapted like this:\n",
"To understand the model it would be convenient if you have gone through demo1 and 2, however can learn how to use the model simply reading this notebook. \n",
"To understand the model it would be convenient if you have gone through demo1 and 2, however you can learn how to use the model simply reading this notebook. \n",
"\n",
"I will use 3 examples to illustrate the different set-ups that can be used with this pytorch implementation of wide and deep."
]
...
...
@@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 8,
"metadata": {
"collapsed": false
},
...
...
@@ -196,7 +196,7 @@
"4 0 "
]
},
"execution_count": 37,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -215,7 +215,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Logistic regression with varying embedding dimensions and no dropout"
"## 1. Logistic regression with varying embedding dimensions, no dropout and Adam optimizer."