Skip to content

Commit 7c8b0a4

Browse files
Merge pull request #2125 from synandi:patch-9
PiperOrigin-RevId: 482890041
2 parents bfb373d + 540abd6 commit 7c8b0a4

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

site/en/guide/migrate/canned_estimators.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"id": "77z2OchJTk0l"
3838
},
3939
"source": [
40-
"# Migration Examples: Canned Estimators\n",
40+
"# Migration examples: Canned Estimators\n",
4141
"\n",
4242
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
4343
" <td>\n",
@@ -75,7 +75,7 @@
7575
"* From `tf.estimator`'s `DNNLinearCombinedEstimator`, `Classifier` or `Regressor` in TensorFlow 1 to `tf.compat.v1.keras.models.WideDeepModel` in TensorFlow 2\n",
7676
"* From `tf.estimator`'s `BoostedTreesEstimator`, `Classifier` or `Regressor` in TensorFlow 1 to `tfdf.keras.GradientBoostedTreesModel` in TensorFlow 2\n",
7777
"\n",
78-
"A common precursor to the training of a model is feature preprocessing, which is done for TensorFlow 1 Estimator models with `tf.feature_column`. For more information on feature preprocessing in TensorFlow 2, see [this guide on migrating from feature columns to the Keras preprocessing layers API](migrating_feature_columns.ipynb)."
78+
"A common precursor to the training of a model is feature preprocessing, which is done for TensorFlow 1 Estimator models with `tf.feature_column`. For more information on feature preprocessing in TensorFlow 2, check out [this guide on migrating from feature columns to the Keras preprocessing layers API](migrating_feature_columns.ipynb)."
7979
]
8080
},
8181
{
@@ -357,7 +357,7 @@
357357
"id": "6xJz6px6pln-"
358358
},
359359
"source": [
360-
"### TF2: Using Keras to Create a Custom DNN Model"
360+
"### TF2: Using Keras to create a custom DNN model"
361361
]
362362
},
363363
{
@@ -368,7 +368,7 @@
368368
"source": [
369369
"In TensorFlow 2, you can create a custom DNN model to substitute for one generated by `tf.estimator.DNNEstimator`, with similar levels of user-specified customization (for instance, as in the previous example, the ability to customize a chosen model optimizer).\n",
370370
"\n",
371-
"A similar workflow can be used to replace `tf.estimator.experimental.RNNEstimator` with a Keras RNN Model. Keras provides a number of built-in, customizable choices by way of `tf.keras.layers.RNN`, `tf.keras.layers.LSTM`, and `tf.keras.layers.GRU` - see [here](https://www.tensorflow.org/guide/keras/rnn#built-in_rnn_layers_a_simple_example) for more details."
371+
"A similar workflow can be used to replace `tf.estimator.experimental.RNNEstimator` with a Keras RNN Model. Keras provides a number of built-in, customizable choices by way of `tf.keras.layers.RNN`, `tf.keras.layers.LSTM`, and `tf.keras.layers.GRU`. Refer to _Built-in RNN layers: a simple example_ in the [RNN with Keras guide](https://www.tensorflow.org/guide/keras/rnn#built-in_rnn_layers_a_simple_example) for more details."
372372
]
373373
},
374374
{
@@ -488,7 +488,7 @@
488488
},
489489
"outputs": [],
490490
"source": [
491-
"# Create LinearModel and DNN Model as in Examples 1 and 2\n",
491+
"# Create a LinearModel and a DNN model as in Examples 1 and 2\n",
492492
"optimizer = create_sample_optimizer('tf2')\n",
493493
"\n",
494494
"linear_model = tf.compat.v1.keras.experimental.LinearModel()\n",
@@ -620,7 +620,7 @@
620620
"id": "B1qTdAS-VpXk"
621621
},
622622
"source": [
623-
"Create a TensorFlow dataset. Note that Decision Forests support natively many types of features and do not need pre-processing."
623+
"Create a TensorFlow dataset. Note that Decision Forests natively support many types of features and do not need pre-processing."
624624
]
625625
},
626626
{
@@ -634,7 +634,7 @@
634634
"train_dataframe = pd.read_csv('https://storage.googleapis.com/tf-datasets/titanic/train.csv')\n",
635635
"eval_dataframe = pd.read_csv('https://storage.googleapis.com/tf-datasets/titanic/eval.csv')\n",
636636
"\n",
637-
"# Convert the Pandas Dataframes into TensorFlow datasets.\n",
637+
"# Convert the pandas Dataframes into TensorFlow datasets.\n",
638638
"train_dataset = tfdf.keras.pd_dataframe_to_tf_dataset(train_dataframe, label=\"survived\")\n",
639639
"eval_dataset = tfdf.keras.pd_dataframe_to_tf_dataset(eval_dataframe, label=\"survived\")"
640640
]
@@ -689,9 +689,9 @@
689689
"id": "Z22UJ5SUqToQ"
690690
},
691691
"source": [
692-
"Gradient Boosted Trees is just one of the many decision forests algorithms avaiable in TensorFlow Decision Forests. For example, Random Forests (available as [tfdf.keras.GradientBoostedTreesModel](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/RandomForestModel) is very resistant to overfitting) while CART (available as [tfdf.keras.CartModel](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/CartModel)) is great for model interpretation.\n",
692+
"Gradient Boosted Trees is just one of the many decision forest algorithms available in TensorFlow Decision Forests. For example, Random Forests (available as [tfdf.keras.GradientBoostedTreesModel](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/RandomForestModel) is very resistant to overfitting) while CART (available as [tfdf.keras.CartModel](https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/CartModel)) is great for model interpretation.\n",
693693
"\n",
694-
"In the next example, we train and plot a Random Forest model."
694+
"In the next example, you'll train and plot a Random Forest model."
695695
]
696696
},
697697
{
@@ -718,7 +718,7 @@
718718
"id": "Z0QYolhoZb_k"
719719
},
720720
"source": [
721-
"Finally, in the next example, we train and evaluate a CART model."
721+
"In the final example, you'll train and evaluate a CART model."
722722
]
723723
},
724724
{

site/en/guide/migrate/tflite.ipynb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@
6767
"id": "meUTrR4I6m1C"
6868
},
6969
"source": [
70-
"[TensorFlow Lite](https://www.tensorflow.org/lite/guide) (TFLite) is a set of tools that helps developers run ML inference on-device (mobile, embedded, and IoT devices). The [TFLite converter](https://www.tensorflow.org/lite/convert) is one such tool that converts exisiting TF models into an optimized TFLite model format that can be efficiently run on-device.\n",
70+
"[TensorFlow Lite](https://www.tensorflow.org/lite/guide) (TFLite) is a set of tools that helps developers run ML inference on-device (mobile, embedded, and IoT devices). The [TFLite converter](https://www.tensorflow.org/lite/convert) is one such tool that converts existing TF models into an optimized TFLite model format that can be efficiently run on-device.\n",
7171
"\n",
7272
"In this doc, you'll learn what changes you need to make to your TF to TFLite conversion code, followed by a few examples that do the same.\n",
7373
"\n",
7474
"\n",
7575
"## Changes to your TF to TFLite conversion code\n",
7676
"\n",
77-
"* If you're using a legacy TF1 model format (Keras file, frozen GraphDef, checkpoints, tf.Session, etc), update it to TF1/TF2 SavedModel and use the TF2 converter API `tf.lite.TFLiteConverter.from_saved_model(...)` to convert it to a TFLite model (refer to Table 1).\n",
77+
"* If you're using a legacy TF1 model format (such as Keras file, frozen GraphDef, checkpoints, tf.Session), update it to TF1/TF2 SavedModel and use the TF2 converter API `tf.lite.TFLiteConverter.from_saved_model(...)` to convert it to a TFLite model (refer to Table 1).\n",
7878
"\n",
7979
"* Update the converter API flags (refer to Table 2).\n",
8080
"* Remove legacy APIs such as `tf.lite.constants`. (eg: Replace `tf.lite.constants.INT8` with `tf.int8`)\n",
@@ -125,7 +125,7 @@
125125
"source": [
126126
"## Examples\n",
127127
"\n",
128-
"You'll now walkthrough some examples to convert legacy TF1 models to TF1/TF2 SavedModels and then convert it to TF2 TFLite models.\n",
128+
"You'll now walk through some examples to convert legacy TF1 models to TF1/TF2 SavedModels and then convert them to TF2 TFLite models.\n",
129129
"\n",
130130
"### Setup\n",
131131
"\n",
@@ -400,7 +400,7 @@
400400
"with tf.Graph().as_default() as g:\n",
401401
" tf.graph_util.import_graph_def(gdef, name=\"\")\n",
402402
"\n",
403-
"# Lookup the input and output tensors.\n",
403+
"# Look up the input and output tensors.\n",
404404
"input_tensor = g.get_tensor_by_name('input:0') \n",
405405
"output_tensor = g.get_tensor_by_name('MobilenetV1/Predictions/Softmax:0')\n",
406406
"\n",
@@ -436,7 +436,6 @@
436436
"colab": {
437437
"collapsed_sections": [],
438438
"name": "tflite.ipynb",
439-
"provenance": [],
440439
"toc_visible": true
441440
},
442441
"kernelspec": {

0 commit comments

Comments
 (0)