Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
957ee975
Commit
957ee975
authored
Jul 12, 2018
by
Mark Daoust
Browse files
Resolve review comments - part 1
parent
66df4538
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
samples/core/tutorials/estimators/wide.ipynb
samples/core/tutorials/estimators/wide.ipynb
+15
-19
No files found.
samples/core/tutorials/estimators/wide.ipynb
View file @
957ee975
...
@@ -356,14 +356,12 @@
...
@@ -356,14 +356,12 @@
"source": [
"source": [
"ds = easy_input_function(train_df, label_key='income_bracket', num_epochs=5, shuffle=True, batch_size=10)\n",
"ds = easy_input_function(train_df, label_key='income_bracket', num_epochs=5, shuffle=True, batch_size=10)\n",
"\n",
"\n",
"for feature_batch, label_batch in ds:\n",
"for feature_batch, label_batch in ds.take(1):\n",
" break\n",
" print('Some feature keys:', list(feature_batch.keys())[:5])\n",
" \n",
" print()\n",
"print('Some feature keys:', list(feature_batch.keys())[:5])\n",
" print('A batch of Ages :', feature_batch['age'])\n",
"print()\n",
" print()\n",
"print('A batch of Ages :', feature_batch['age'])\n",
" print('A batch of Labels:', label_batch )"
"print()\n",
"print('A batch of Labels:', label_batch )"
],
],
"execution_count": 0,
"execution_count": 0,
"outputs": []
"outputs": []
...
@@ -426,14 +424,12 @@
...
@@ -426,14 +424,12 @@
},
},
"cell_type": "code",
"cell_type": "code",
"source": [
"source": [
"for feature_batch, label_batch in ds:\n",
"for feature_batch, label_batch in ds.take(1):\n",
" break\n",
" print('Feature keys:', list(feature_batch.keys())[:5])\n",
" \n",
" print()\n",
"print('Feature keys:', list(feature_batch.keys())[:5])\n",
" print('Age batch :', feature_batch['age'])\n",
"print()\n",
" print()\n",
"print('Age batch :', feature_batch['age'])\n",
" print('Label batch :', label_batch )"
"print()\n",
"print('Label batch :', label_batch )"
],
],
"execution_count": 0,
"execution_count": 0,
"outputs": []
"outputs": []
...
@@ -546,7 +542,7 @@
...
@@ -546,7 +542,7 @@
},
},
"cell_type": "code",
"cell_type": "code",
"source": [
"source": [
"classifier = tf.estimator.LinearClassifier(feature_columns=[age]
, n_classes=2
)\n",
"classifier = tf.estimator.LinearClassifier(feature_columns=[age])\n",
"classifier.train(train_inpf)\n",
"classifier.train(train_inpf)\n",
"result = classifier.evaluate(test_inpf)\n",
"result = classifier.evaluate(test_inpf)\n",
"\n",
"\n",
...
@@ -627,7 +623,7 @@
...
@@ -627,7 +623,7 @@
},
},
"cell_type": "code",
"cell_type": "code",
"source": [
"source": [
"classifier = tf.estimator.LinearClassifier(feature_columns=my_numeric_columns
, n_classes=2
)\n",
"classifier = tf.estimator.LinearClassifier(feature_columns=my_numeric_columns)\n",
"classifier.train(train_inpf)\n",
"classifier.train(train_inpf)\n",
"\n",
"\n",
"result = classifier.evaluate(test_inpf)\n",
"result = classifier.evaluate(test_inpf)\n",
...
@@ -876,7 +872,7 @@
...
@@ -876,7 +872,7 @@
},
},
"cell_type": "code",
"cell_type": "code",
"source": [
"source": [
"classifier = tf.estimator.LinearClassifier(feature_columns=my_numeric_columns+my_categorical_columns
, n_classes=2
)\n",
"classifier = tf.estimator.LinearClassifier(feature_columns=my_numeric_columns+my_categorical_columns)\n",
"classifier.train(train_inpf)\n",
"classifier.train(train_inpf)\n",
"result = classifier.evaluate(test_inpf)\n",
"result = classifier.evaluate(test_inpf)\n",
"\n",
"\n",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment