Skip to content

Commit

Permalink
nblint
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaspiridonov committed Dec 19, 2023
1 parent 94e116f commit 833089e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions site/zh-cn/probability/examples/Gaussian_Copula.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"# Copula 入门\n",
"\n",
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" <td> <a target=\"_blank\" href=\"https://www.tensorflow.org/probability/examples/Gaussian_Copula\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\">View on TensorFlow.org</a>\n",
" <td> <a target=\"_blank\" href=\"https://tensorflow.google.cn/probability/examples/Gaussian_Copula\"><img src=\"https://tensorflow.google.cn/images/tf_logo_32px.png\">View on TensorFlow.org</a>\n",
"</td>\n",
" <td><a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/probability/blob/main/tensorflow_probability/examples/jupyter_notebooks/Gaussian_Copula.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\">在 Google Colab 中运行</a></td>\n",
" <td><a target=\"_blank\" href=\"https://github.com/tensorflow/probability/blob/main/tensorflow_probability/examples/jupyter_notebooks/Gaussian_Copula.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\">在 GitHub 上查看源代码</a></td>\n",
" <td> <a href=\"https://storage.googleapis.com/tensorflow_docs/probability/tensorflow_probability/examples/jupyter_notebooks/Gaussian_Copula.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\">下载笔记本</a> </td>\n",
" <td><a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/docs-l10n/blob/master/site/zh-cn/probability/examples/Gaussian_Copula.ipynb\"><img src=\"https://tensorflow.google.cn/images/colab_logo_32px.png\">在 Google Colab 中运行</a></td>\n",
" <td><a target=\"_blank\" href=\"https://github.com/tensorflow/docs-l10n/blob/master/site/zh-cn/probability/examples/Gaussian_Copula.ipynb\"><img src=\"https://tensorflow.google.cn/images/GitHub-Mark-32px.png\">在 GitHub 上查看源代码</a></td>\n",
" <td> <a href=\"https://storage.googleapis.com/tensorflow_docs/docs-l10n/site/zh-cn/probability/examples/Gaussian_Copula.ipynb\"><img src=\"https://tensorflow.google.cn/images/download_logo_32px.png\">下载笔记本</a> </td>\n",
"</table>"
]
},
Expand Down Expand Up @@ -99,7 +99,7 @@
"\n",
"因此,我们得到的高斯 Copula 是在单位超立方体 $[0, 1]^n$ 上具有均匀边缘的分布。\n",
"\n",
"这样定义的高斯 Copula 可以使用 `tfd.TransformedDistribution` 和适当的 `Bijector` 来实现。也就是说,我们通过使用正态分布的逆 CDF(由 [`tfb.NormalCDF`](https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/NormalCDF) 双射器实现)来变换多元正态分布。"
"这样定义的高斯 Copula 可以使用 `tfd.TransformedDistribution` 和适当的 `Bijector` 来实现。也就是说,我们通过使用正态分布的逆 CDF(由 [`tfb.NormalCDF`](https://tensorflow.google.cn/probability/api_docs/python/tfp/bijectors/NormalCDF) 双射器实现)来变换多元正态分布。"
]
},
{
Expand Down Expand Up @@ -239,7 +239,7 @@
"source": [
"现在,我们使用高斯 Copula 将分布耦合在一起,并进行绘制。同样,我们选择的工具是 `TransformedDistribution`,应用适当的 `Bijector` 来获得所选的边缘。\n",
"\n",
"具体来说,我们使用 [`Blockwise`](https://www.tensorflow.org/probability/api_docs/python/tfp/bijectors/Blockwise) 双射器,它会在向量的不同部分应用不同的双射器(仍然是双射变换)。"
"具体来说,我们使用 [`Blockwise`](https://tensorflow.google.cn/probability/api_docs/python/tfp/bijectors/Blockwise) 双射器,它会在向量的不同部分应用不同的双射器(仍然是双射变换)。"
]
},
{
Expand Down
22 changes: 11 additions & 11 deletions site/zh-cn/tutorials/distribute/dtensor_ml_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
},
"source": [
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" <td> <a target=\"_blank\" href=\"https://www.tensorflow.org/tutorials/distribute/dtensor_ml_tutorial\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\">View on TensorFlow.org</a>\n",
" <td> <a target=\"_blank\" href=\"https://tensorflow.google.cn/tutorials/distribute/dtensor_ml_tutorial\"><img src=\"https://tensorflow.google.cn/images/tf_logo_32px.png\">View on TensorFlow.org</a>\n",
"</td>\n",
" <td><a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/distribute/dtensor_ml_tutorial.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\">在 Google Colab 中运行</a></td>\n",
" <td> <a target=\"_blank\" href=\"https://github.com/tensorflow/docs/blob/master/site/en/tutorials/distribute/dtensor_ml_tutorial.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\">在 GitHub 上查看源代码</a>\n",
" <td><a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/docs-l10n/blob/master/site/zh-cn/tutorials/distribute/dtensor_ml_tutorial.ipynb\"><img src=\"https://tensorflow.google.cn/images/colab_logo_32px.png\">在 Google Colab 中运行</a></td>\n",
" <td> <a target=\"_blank\" href=\"https://github.com/tensorflow/docs-l10n/blob/master/site/zh-cn/tutorials/distribute/dtensor_ml_tutorial.ipynb\"><img src=\"https://tensorflow.google.cn/images/GitHub-Mark-32px.png\">在 GitHub 上查看源代码</a>\n",
"</td>\n",
" <td> <a href=\"https://storage.googleapis.com/tensorflow_docs/docs/site/en/tutorials/distribute/dtensor_ml_tutorial.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\">下载笔记本</a> </td>\n",
" <td> <a href=\"https://storage.googleapis.com/tensorflow_docs/docs-l10n/site/zh-cn/tutorials/distribute/dtensor_ml_tutorial.ipynb\"><img src=\"https://tensorflow.google.cn/images/download_logo_32px.png\">下载笔记本</a> </td>\n",
"</table>"
]
},
Expand All @@ -64,7 +64,7 @@
"source": [
"## 文本特征向量\n",
"\n",
"DTensor 为您提供了一种进行跨设备分布式模型训练的方式,可以帮助您提高效率、可靠性和可扩展性。有关 DTensor 概念的更多详细信息,请参阅 [DTensor 编程指南](https://www.tensorflow.org/guide/dtensor_overview)。\n",
"DTensor 为您提供了一种进行跨设备分布式模型训练的方式,可以帮助您提高效率、可靠性和可扩展性。有关 DTensor 概念的更多详细信息,请参阅 [DTensor 编程指南](https://tensorflow.google.cn/guide/dtensor_overview)。\n",
"\n",
"在本教程中,您将使用 DTensor 训练一个情感分析模型。此示例演示了三种分布式训练方案:\n",
"\n",
Expand Down Expand Up @@ -388,7 +388,7 @@
"id": "udFGAO-NrZw6"
},
"source": [
"<img src=\"https://www.tensorflow.org/images/dtensor/no_dtensor.png\" class=\"no-filter\" alt=\"The input and weight matrices for a non distributed model.\">\n"
"<img src=\"https://tensorflow.google.cn/images/dtensor/no_dtensor.png\" class=\"no-filter\" alt=\"The input and weight matrices for a non distributed model.\">\n"
]
},
{
Expand Down Expand Up @@ -585,7 +585,7 @@
"\n",
"典型的数据并行训练循环使用由单个 `batch` 维度组成的 DTensor `Mesh`,其中每个设备都将成为从全局批次接收分片的副本。\n",
"\n",
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_data_para.png\" class=\"no-filter\" alt=\"Data parallel mesh\">\n",
"<img src=\"https://tensorflow.google.cn/images/dtensor/dtensor_data_para.png\" class=\"no-filter\" alt=\"Data parallel mesh\">\n",
"\n",
"复制的模型在副本上运行,因此模型变量是完全复制的(未分片)。"
]
Expand Down Expand Up @@ -645,7 +645,7 @@
"source": [
"### 训练步骤\n",
"\n",
"此示例使用的是随机梯度下降优化器和自定义训练循环 (CTL)。有关这些主题的更多信息,请参阅[自定义训练循环指南](https://www.tensorflow.org/guide/keras/writing_a_training_loop_from_scratch)和[演练](https://www.tensorflow.org/tutorials/customization/custom_training_walkthrough)。\n",
"此示例使用的是随机梯度下降优化器和自定义训练循环 (CTL)。有关这些主题的更多信息,请参阅[自定义训练循环指南](https://tensorflow.google.cn/guide/keras/writing_a_training_loop_from_scratch)和[演练](https://tensorflow.google.cn/tutorials/customization/custom_training_walkthrough)。\n",
"\n",
"将 `train_step` 封装为 `tf.function` 以指示该函数体将作为 TensorFlow 计算图进行跟踪。`train_step` 的函数体由前向推断传递、反向梯度传递和变量更新组成。\n",
"\n",
Expand Down Expand Up @@ -771,7 +771,7 @@
"- 有 4 个模型副本,训练数据批次会分布至这 4 个副本。\n",
"- 单个模型副本中的 2 个设备会接收复制的训练数据。\n",
"\n",
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_model_para.png\" class=\"no-filter\" alt=\"Model parallel mesh\">\n"
"<img src=\"https://tensorflow.google.cn/images/dtensor/dtensor_model_para.png\" class=\"no-filter\" alt=\"Model parallel mesh\">\n"
]
},
{
Expand Down Expand Up @@ -862,7 +862,7 @@
"source": [
"训练维数特别高的数据(例如非常大的图像或视频)时,可能会需要沿特征维度进行分片。这称为[空间分区](https://cloud.google.com/blog/products/ai-machine-learning/train-ml-models-on-large-images-and-3d-volumes-with-spatial-partitioning-on-cloud-tpus),它首次被引入到 TensorFlow 中,用于训练具有大量三维输入样本的模型。\n",
"\n",
"<img src=\"https://www.tensorflow.org/images/dtensor/dtensor_spatial_para.png\" class=\"no-filter\" alt=\"Spatial parallel mesh\">\n",
"<img src=\"https://tensorflow.google.cn/images/dtensor/dtensor_spatial_para.png\" class=\"no-filter\" alt=\"Spatial parallel mesh\">\n",
"\n",
"DTensor 也支持这种情况。您需要进行的唯一更改是创建一个包含 `feature` 维度的网格,并应用相应的 `Layout`。\n"
]
Expand Down Expand Up @@ -1040,7 +1040,7 @@
"\n",
"在现实世界的机器学习应用中,应当应用评估和交叉验证以避免产生过拟合模型。本教程中介绍的技术也可用于将并行性引入到评估当中。\n",
"\n",
"从头开始使用 `tf.Module` 构建模型涉及到大量工作,而重复使用现有的构建块(例如层和辅助函数)可以大大加快模型开发速度。截至 TensorFlow 2.9 版本,`tf.keras.layers` 下的所有 Keras 层都接受 DTensor 布局作为其参数,并可用于构建 DTensor 模型。您甚至可以直接对 DTensor 重复使用 Keras 模型,而无需修改模型实现。有关使用 DTensor Keras 的信息,请参阅 [DTensor Keras 集成教程](https://www.tensorflow.org/tutorials/distribute/dtensor_keras_tutorial)。 "
"从头开始使用 `tf.Module` 构建模型涉及到大量工作,而重复使用现有的构建块(例如层和辅助函数)可以大大加快模型开发速度。截至 TensorFlow 2.9 版本,`tf.keras.layers` 下的所有 Keras 层都接受 DTensor 布局作为其参数,并可用于构建 DTensor 模型。您甚至可以直接对 DTensor 重复使用 Keras 模型,而无需修改模型实现。有关使用 DTensor Keras 的信息,请参阅 [DTensor Keras 集成教程](https://tensorflow.google.cn/tutorials/distribute/dtensor_keras_tutorial)。 "
]
}
],
Expand Down
12 changes: 6 additions & 6 deletions site/zh-cn/tutorials/quickstart/advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
},
"source": [
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" <td> <a target=\"_blank\" href=\"https://www.tensorflow.org/tutorials/quickstart/advanced\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\">View on TensorFlow.org</a>\n",
" <td> <a target=\"_blank\" href=\"https://tensorflow.google.cn/tutorials/quickstart/advanced\"><img src=\"https://tensorflow.google.cn/images/tf_logo_32px.png\">View on TensorFlow.org</a>\n",
"</td>\n",
" <td><a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/quickstart/advanced.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\">在 Google Colab 中运行</a></td>\n",
" <td> <a target=\"_blank\" href=\"https://github.com/tensorflow/docs/blob/master/site/en/tutorials/quickstart/advanced.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\">在 GitHub 上查看源代码</a>\n",
" <td><a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/docs-l10n/blob/master/site/zh-cn/tutorials/quickstart/advanced.ipynb\"><img src=\"https://tensorflow.google.cn/images/colab_logo_32px.png\">在 Google Colab 中运行</a></td>\n",
" <td> <a target=\"_blank\" href=\"https://github.com/tensorflow/docs-l10n/blob/master/site/zh-cn/tutorials/quickstart/advanced.ipynb\"><img src=\"https://tensorflow.google.cn/images/GitHub-Mark-32px.png\">在 GitHub 上查看源代码</a>\n",
"</td>\n",
" <td> <a href=\"https://storage.googleapis.com/tensorflow_docs/docs/site/en/tutorials/quickstart/advanced.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\">下载笔记本</a> </td>\n",
" <td> <a href=\"https://storage.googleapis.com/tensorflow_docs/docs-l10n/site/zh-cn/tutorials/quickstart/advanced.ipynb\"><img src=\"https://tensorflow.google.cn/images/download_logo_32px.png\">下载笔记本</a> </td>\n",
"</table>"
]
},
Expand All @@ -76,7 +76,7 @@
"source": [
"下载并安装 TensorFlow 2。将 TensorFlow 导入您的程序:\n",
"\n",
"注:升级 `pip` 以安装 TensorFlow 2 软件包。请参阅[安装指南](https://www.tensorflow.org/install)了解详细信息。"
"注:升级 `pip` 以安装 TensorFlow 2 软件包。请参阅[安装指南](https://tensorflow.google.cn/install)了解详细信息。"
]
},
{
Expand Down Expand Up @@ -331,7 +331,7 @@
"id": "T4JfEh7kvx6m"
},
"source": [
"现在,经过训练,照片分类器在此数据集上的准确率约为 98%。要了解详情,请阅读 [TensorFlow 教程](https://www.tensorflow.org/tutorials)。"
"现在,经过训练,照片分类器在此数据集上的准确率约为 98%。要了解详情,请阅读 [TensorFlow 教程](https://tensorflow.google.cn/tutorials)。"
]
}
],
Expand Down

0 comments on commit 833089e

Please sign in to comment.