Skip to content

Commit e886baa

Browse files
MarkDaoustcopybara-github
authored andcommitted
Make relative links to the keras guides illegal.
* `../guide/keras` is illegal everywhere. * `](keras` and `../keras` are illegal in guide/ PiperOrigin-RevId: 405444783
1 parent ed6b132 commit e886baa

23 files changed

Lines changed: 43 additions & 43 deletions

‎site/en/guide/basic_training_loops.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"source": [
7171
"In the previous guides, you have learned about [tensors](./tensor.ipynb), [variables](./variable.ipynb), [gradient tape](autodiff.ipynb), and [modules](./intro_to_modules.ipynb). In this guide, you will fit these all together to train models.\n",
7272
"\n",
73-
"TensorFlow also includes the [tf.Keras API](keras/overview.ipynb), a high-level neural network API that provides useful abstractions to reduce boilerplate. However, in this guide, you will use basic classes."
73+
"TensorFlow also includes the [tf.Keras API](https://www.tensorflow.org/guide/keras/overview), a high-level neural network API that provides useful abstractions to reduce boilerplate. However, in this guide, you will use basic classes."
7474
]
7575
},
7676
{
@@ -523,7 +523,7 @@
523523
"\n",
524524
"This is, however, an extremely simple problem. For a more practical introduction, see [Custom training walkthrough](../tutorials/customization/custom_training_walkthrough.ipynb).\n",
525525
"\n",
526-
"For more on using built-in Keras training loops, see [this guide](keras/train_and_evaluate.ipynb). For more on training loops and Keras, see [this guide](keras/writing_a_training_loop_from_scratch.ipynb). For writing custom distributed training loops, see [this guide](distributed_training.ipynb#using_tfdistributestrategy_with_basic_training_loops_loops)."
526+
"For more on using built-in Keras training loops, see [this guide](https://www.tensorflow.org/guide/keras/train_and_evaluate). For more on training loops and Keras, see [this guide](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch). For writing custom distributed training loops, see [this guide](distributed_training.ipynb#using_tfdistributestrategy_with_basic_training_loops_loops)."
527527
]
528528
}
529529
],

‎site/en/guide/distributed_training.ipynb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"* Provide good performance out of the box.\n",
7979
"* Easy switching between strategies.\n",
8080
"\n",
81-
"You can distribute training using `tf.distribute.Strategy` with a high-level API like Keras `Model.fit`, as well as [custom training loops](keras/writing_a_training_loop_from_scratch.ipynb) (and, in general, any computation using TensorFlow).\n",
81+
"You can distribute training using `tf.distribute.Strategy` with a high-level API like Keras `Model.fit`, as well as [custom training loops](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch) (and, in general, any computation using TensorFlow).\n",
8282
"\n",
8383
"In TensorFlow 2.x, you can execute your programs eagerly, or in a graph using [`tf.function`](function.ipynb). `tf.distribute.Strategy` intends to support both these modes of execution, but works best with `tf.function`. Eager mode is only recommended for debugging purposes and not supported for `tf.distribute.TPUStrategy`. Although training is the focus of this guide, this API can also be used for distributing evaluation and prediction on different platforms.\n",
8484
"\n",

‎site/en/guide/intro_to_graphs.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"source": [
7171
"## Overview\n",
7272
"\n",
73-
"This guide goes beneath the surface of TensorFlow and Keras to demonstrate how TensorFlow works. If you instead want to immediately get started with Keras, check out the [collection of Keras guides](keras/).\n",
73+
"This guide goes beneath the surface of TensorFlow and Keras to demonstrate how TensorFlow works. If you instead want to immediately get started with Keras, check out the [collection of Keras guides](https://www.tensorflow.org/guide/keras/).\n",
7474
"\n",
7575
"In this guide, you'll learn how TensorFlow allows you to make simple changes to your code to get graphs, how graphs are stored and represented, and how you can use them to accelerate your models.\n",
7676
"\n",
@@ -763,7 +763,7 @@
763763
"id": "Q1Pfo5YwwILi"
764764
},
765765
"source": [
766-
"`tf.function` is commonly used to speed up training loops, and you can learn more about it in [Writing a training loop from scratch](keras/writing_a_training_loop_from_scratch#speeding-up_your_training_step_with_tffunction) with Keras.\n",
766+
"`tf.function` is commonly used to speed up training loops, and you can learn more about it in [Writing a training loop from scratch](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch#speeding-up_your_training_step_with_tffunction) with Keras.\n",
767767
"\n",
768768
"Note: You can also try [`tf.function(jit_compile=True)`](https://www.tensorflow.org/xla#explicit_compilation_with_tffunctionjit_compiletrue) for a more significant performance boost, especially if your code is heavy on TF control flow and uses many small tensors."
769769
]

‎site/en/guide/intro_to_modules.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@
696696
"\n",
697697
"Note that up until this point, there is no mention of Keras. You can build your own high-level API on top of `tf.Module`, and people have. \n",
698698
"\n",
699-
"In this section, you will examine how Keras uses `tf.Module`. A complete user guide to Keras models can be found in the [Keras guide](keras/sequential_model.ipynb).\n"
699+
"In this section, you will examine how Keras uses `tf.Module`. A complete user guide to Keras models can be found in the [Keras guide](https://www.tensorflow.org/guide/keras/sequential_model).\n"
700700
]
701701
},
702702
{
@@ -1088,7 +1088,7 @@
10881088
"id": "xKyjlkceqjwD"
10891089
},
10901090
"source": [
1091-
"There is more to know about saving and serialization of Keras models, including providing configuration methods for custom layers for feature support. Check out the [guide to saving and serialization](keras/save_and_serialize)."
1091+
"There is more to know about saving and serialization of Keras models, including providing configuration methods for custom layers for feature support. Check out the [guide to saving and serialization](https://www.tensorflow.org/guide/keras/save_and_serialize)."
10921092
]
10931093
},
10941094
{

‎site/en/guide/migrate/checkpoint_saver.ipynb‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
"- Save continually at a certain frequency (using the `save_freq` argument).\n",
7878
"- Save the weights/parameters only instead of the whole model by setting `save_weights_only` to `True`.\n",
7979
"\n",
80-
"For more details, refer to the `tf.keras.callbacks.ModelCheckpoint` API docs and the *Save checkpoints during training* section in the [Save and load models](../../tutorials/keras/save_and_load.ipynb) tutorial. Learn more about the Checkpoint format in the *TF Checkpoint format* section in the [Save and load Keras models](../../guide/keras/save_and_serialize.ipynb) guide. In addition, to add fault tolerance, you can use `tf.keras.callbacks.experimental.BackupAndRestore` or `tf.train.Checkpoint` for manual checkpointing. Learn more in the [Fault tolerance migration guide](fault_tolerance.ipynb).\n",
80+
"For more details, refer to the `tf.keras.callbacks.ModelCheckpoint` API docs and the *Save checkpoints during training* section in the [Save and load models](../../tutorials/keras/save_and_load.ipynb) tutorial. Learn more about the Checkpoint format in the *TF Checkpoint format* section in the [Save and load Keras models](https://www.tensorflow.org/guide/keras/save_and_serialize) guide. In addition, to add fault tolerance, you can use `tf.keras.callbacks.experimental.BackupAndRestore` or `tf.train.Checkpoint` for manual checkpointing. Learn more in the [Fault tolerance migration guide](fault_tolerance.ipynb).\n",
8181
"\n",
82-
"Keras [callbacks](../../guide/keras/custom_callback.ipynb) are objects that are called at different points during training/evaluation/prediction in the built-in Keras `Model.fit`/`Model.evaluate`/`Model.predict` APIs. Learn more in the _Next steps_ section at the end of the guide."
82+
"Keras [callbacks](https://www.tensorflow.org/guide/keras/custom_callback) are objects that are called at different points during training/evaluation/prediction in the built-in Keras `Model.fit`/`Model.evaluate`/`Model.predict` APIs. Learn more in the _Next steps_ section at the end of the guide."
8383
]
8484
},
8585
{
@@ -201,7 +201,7 @@
201201
"source": [
202202
"## TensorFlow 2: Save checkpoints with a Keras callback for Model.fit\n",
203203
"\n",
204-
"In TensorFlow 2, when you use the built-in Keras `Model.fit` (or `Model.evaluate`) for training/evaluation, you can configure `tf.keras.callbacks.ModelCheckpoint` and then pass it to the `callbacks` parameter of `Model.fit` (or `Model.evaluate`). (Learn more in the API docs and the *Using callbacks* section in the [Training and evaluation with the built-in methods](../../guide/keras/train_and_evaluate.ipynb) guide.)\n",
204+
"In TensorFlow 2, when you use the built-in Keras `Model.fit` (or `Model.evaluate`) for training/evaluation, you can configure `tf.keras.callbacks.ModelCheckpoint` and then pass it to the `callbacks` parameter of `Model.fit` (or `Model.evaluate`). (Learn more in the API docs and the *Using callbacks* section in the [Training and evaluation with the built-in methods](https://www.tensorflow.org/guide/keras/train_and_evaluate) guide.)\n",
205205
"\n",
206206
"In the example below, you will use a `tf.keras.callbacks.ModelCheckpoint` callback to store checkpoints in a temporary directory:"
207207
]
@@ -263,13 +263,13 @@
263263
"\n",
264264
"- API docs: `tf.keras.callbacks.ModelCheckpoint`\n",
265265
"- Tutorial: [Save and load models](../../tutorials/keras/save_and_load.ipynb) (the *Save checkpoints during training* section)\n",
266-
"- Guide: [Save and load Keras models](../../guide/keras/save_and_serialize.ipynb) (the *TF Checkpoint format* section)\n",
266+
"- Guide: [Save and load Keras models](https://www.tensorflow.org/guide/keras/save_and_serialize) (the *TF Checkpoint format* section)\n",
267267
"\n",
268268
"Learn more about callbacks in:\n",
269269
"\n",
270270
"- API docs: `tf.keras.callbacks.Callback`\n",
271-
"- Guide: [Writing your own callbacks](../..guide/keras/custom_callback.ipynb/)\n",
272-
"- Guide: [Training and evaluation with the built-in methods](../../guide/keras/train_and_evaluate.ipynb) (the *Using callbacks* section)\n",
271+
"- Guide: [Writing your own callbacks](https://www.tensorflow.org/guide/keras/guide/keras/custom_callback)\n",
272+
"- Guide: [Training and evaluation with the built-in methods](https://www.tensorflow.org/guide/keras/train_and_evaluate) (the *Using callbacks* section)\n",
273273
"\n",
274274
"You may also find the following migration-related resources useful:\n",
275275
"\n",

‎site/en/guide/migrate/logging_stop_hook.ipynb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"source": [
7070
"In TensorFlow 1, you use `tf.estimator.LoggingTensorHook` to monitor and log tensors, while `tf.estimator.StopAtStepHook` helps stop training at a specified step when training with `tf.estimator.Estimator`. This notebook demonstrates how to migrate from these APIs to their equivalents in TensorFlow 2 using custom Keras callbacks (`tf.keras.callbacks.Callback`) with `Model.fit`.\n",
7171
"\n",
72-
"Keras [callbacks](../../guide/keras/custom_callback.ipynb) are objects that are called at different points during training/evaluation/prediction in the built-in Keras `Model.fit`/`Model.evaluate`/`Model.predict` APIs. You can learn more about callbacks in the `tf.keras.callbacks.Callback` API docs, as well as the [Writing your own callbacks](../..guide/keras/custom_callback.ipynb/) and [Training and evaluation with the built-in methods](../../guide/keras/train_and_evaluate.ipynb) (the *Using callbacks* section) guides. For migrating from `SessionRunHook` in TensorFlow 1 to Keras callbacks in TensorFlow 2, check out the [Migrate training with assisted logic](sessionrunhook_callback.ipynb) guide."
72+
"Keras [callbacks](https://www.tensorflow.org/guide/keras/custom_callback) are objects that are called at different points during training/evaluation/prediction in the built-in Keras `Model.fit`/`Model.evaluate`/`Model.predict` APIs. You can learn more about callbacks in the `tf.keras.callbacks.Callback` API docs, as well as the [Writing your own callbacks](../..guide/keras/custom_callback.ipynb/) and [Training and evaluation with the built-in methods](https://www.tensorflow.org/guide/keras/train_and_evaluate) (the *Using callbacks* section) guides. For migrating from `SessionRunHook` in TensorFlow 1 to Keras callbacks in TensorFlow 2, check out the [Migrate training with assisted logic](sessionrunhook_callback.ipynb) guide."
7373
]
7474
},
7575
{
@@ -277,7 +277,7 @@
277277
"\n",
278278
"- API docs: `tf.keras.callbacks.Callback`\n",
279279
"- Guide: [Writing your own callbacks](../..guide/keras/custom_callback.ipynb/)\n",
280-
"- Guide: [Training and evaluation with the built-in methods](../../guide/keras/train_and_evaluate.ipynb) (the *Using callbacks* section)\n",
280+
"- Guide: [Training and evaluation with the built-in methods](https://www.tensorflow.org/guide/keras/train_and_evaluate) (the *Using callbacks* section)\n",
281281
"\n",
282282
"You may also find the following migration-related resources useful:\n",
283283
"\n",

‎site/en/guide/migrate/migrating_estimator.ipynb‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"This guide demonstrates how to migrate from TensorFlow 1's `tf.estimator.Estimator` APIs to TensorFlow 2's `tf.keras` APIs. First, you will set up and run a basic model for training and evaluation with `tf.estimator.Estimator`. Then, you will perform the equivalent steps in TensorFlow 2 with the `tf.keras` APIs. You will also learn how to customize the training step by subclassing `tf.keras.Model` and using `tf.GradientTape`.\n",
7171
"\n",
7272
"- In TensorFlow 1, the high-level `tf.estimator.Estimator` APIs let you train and evaluate a model, as well as perform inference and save your model (for serving).\n",
73-
"- In TensorFlow 2, use the Keras APIs to perform the aforementioned tasks, such as [model building](../../guide/keras/custom_layers_and_models.ipynb), gradient application, [training](../../guide/keras/customizing_what_happens_in_fit.ipynb), evaluation, and prediction.\n",
73+
"- In TensorFlow 2, use the Keras APIs to perform the aforementioned tasks, such as [model building](https://www.tensorflow.org/guide/keras/custom_layers_and_models), gradient application, [training](https://www.tensorflow.org/guide/keras/customizing_what_happens_in_fit), evaluation, and prediction.\n",
7474
"\n",
7575
"(For migrating model/checkpoint saving workflows to TensorFlow 2, check out the [SavedModel](saved_model.ipynb) and [Checkpoint](checkpoint_saved.ipynb) migration guides.)"
7676
]
@@ -197,10 +197,10 @@
197197
"source": [
198198
"## TensorFlow 2: Train and evaluate with the built-in Keras methods\n",
199199
"\n",
200-
"This example demonstrates how to perform training and evaluation with Keras `Model.fit` and `Model.evaluate` in TensorFlow 2. (You can learn more in the [Training and evaluation with the built-in methods](../../guide/keras/train_and_evaluate.ipynb) guide.)\n",
200+
"This example demonstrates how to perform training and evaluation with Keras `Model.fit` and `Model.evaluate` in TensorFlow 2. (You can learn more in the [Training and evaluation with the built-in methods](https://www.tensorflow.org/guide/keras/train_and_evaluate) guide.)\n",
201201
"\n",
202202
"- Start by preparing the dataset pipeline with the `tf.data.Dataset` APIs.\n",
203-
"- Define a simple Keras [Sequential](../../guide/keras/sequential_model.ipynb) model with one linear (`tf.keras.layers.Dense`) layer.\n",
203+
"- Define a simple Keras [Sequential](https://www.tensorflow.org/guide/keras/sequential_model) model with one linear (`tf.keras.layers.Dense`) layer.\n",
204204
"- Instantiate an Adagrad optimizer (`tf.keras.optimizers.Adagrad`).\n",
205205
"- Configure the model for training by passing the `optimizer` variable and the mean-squared error (`\"mse\"`) loss to `Model.compile`."
206206
]
@@ -278,9 +278,9 @@
278278
"id": "gHx_RUL8xcJ3"
279279
},
280280
"source": [
281-
"In TensorFlow 2, you can also write your own custom training step function with `tf.GradientTape` to perform forward and backward passes, while still taking advantage of the built-in training support, such as `tf.keras.callbacks.Callback` and `tf.distribute.Strategy`. (Learn more in [Customizing what happens in Model.fit](../../guide/keras/customizing_what_happens_in_fit.ipynb) and [Writing custom training loops from scratch](../../guide/keras/writing_a_training_loop_from_scratch.ipynb).)\n",
281+
"In TensorFlow 2, you can also write your own custom training step function with `tf.GradientTape` to perform forward and backward passes, while still taking advantage of the built-in training support, such as `tf.keras.callbacks.Callback` and `tf.distribute.Strategy`. (Learn more in [Customizing what happens in Model.fit](https://www.tensorflow.org/guide/keras/customizing_what_happens_in_fit) and [Writing custom training loops from scratch](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch).)\n",
282282
"\n",
283-
"In this example, start by creating a custom `tf.keras.Model` by subclassing `tf.keras.Sequential` that overrides `Model.train_step`. (Learn more about [subclassing tf.keras.Model](../../keras/custom_layers_and_models.ipynb)). Inside that class, define a custom `train_step` function that for each batch of data performs a forward pass and backward pass during one training step.\n"
283+
"In this example, start by creating a custom `tf.keras.Model` by subclassing `tf.keras.Sequential` that overrides `Model.train_step`. (Learn more about [subclassing tf.keras.Model](https://www.tensorflow.org/guide/keras/custom_layers_and_models)). Inside that class, define a custom `train_step` function that for each batch of data performs a forward pass and backward pass during one training step.\n"
284284
]
285285
},
286286
{
@@ -394,10 +394,10 @@
394394
"\n",
395395
"Additional Keras resources you may find useful:\n",
396396
"\n",
397-
"- Guide: [Training and evaluation with the built-in methods](../../guide/keras/train_and_evaluate.ipynb)\n",
398-
"- Guide: [Customize what happens in Model.fit](../../guide/keras/customizing_what_happens_in_fit.ipynb)\n",
399-
"- Guide: [Writing a training loop from scratch](../../guide/keras/writing_a_training_loop_from_scratch.ipynb)\n",
400-
"- Guide: [Making new Keras layers and models via subclassing](../../guide/keras/custom_layers_and_models.ipynb)\n",
397+
"- Guide: [Training and evaluation with the built-in methods](https://www.tensorflow.org/guide/keras/train_and_evaluate)\n",
398+
"- Guide: [Customize what happens in Model.fit](https://www.tensorflow.org/guide/keras/customizing_what_happens_in_fit)\n",
399+
"- Guide: [Writing a training loop from scratch](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch)\n",
400+
"- Guide: [Making new Keras layers and models via subclassing](https://www.tensorflow.org/guide/keras/custom_layers_and_models)\n",
401401
"\n",
402402
"The following guides can assist with migrating distribution strategy workflows from `tf.estimator` APIs:\n",
403403
"\n",

‎site/en/guide/migrate/saved_model.ipynb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@
508508
"\n",
509509
"The Keras loading API—`tf.keras.models.load_model`—allows you to reload a saved model back into a Keras Model object. Note that this only allows you to load SavedModels saved with Keras (`Model.save` or `tf.keras.models.save_model`).\n",
510510
"\n",
511-
"Models saved with `tf.saved_model.save` should be loaded with `tf.saved_model.load`. You can load a Keras model saved with `Model.save` using `tf.saved_model.load` but you will only get the TensorFlow graph. Refer to the `tf.keras.models.load_model` API docs and [Save and load Keras models](../../guide/keras/save_and_serialize#savedmodel_format) guide for details."
511+
"Models saved with `tf.saved_model.save` should be loaded with `tf.saved_model.load`. You can load a Keras model saved with `Model.save` using `tf.saved_model.load` but you will only get the TensorFlow graph. Refer to the `tf.keras.models.load_model` API docs and [Save and load Keras models](https://www.tensorflow.org/guide/keras/save_and_serialize#savedmodel_format) guide for details."
512512
]
513513
},
514514
{

0 commit comments

Comments
 (0)