提交 99ffab55 编写于 作者: W wizardforcel

2020-08-05 18:44:51

上级 052f1b02
......@@ -42,7 +42,7 @@ install_tensorflow()
1. 默认情况下,安装功能会创建虚拟环境并在虚拟环境中安装`tensorflow `软件包。
有四种可用的安装方法,可以使用 method 参数指定:
有四种可用的安装方法,可以使用`method`参数指定:
| | |
| --- | --- |
......@@ -73,7 +73,7 @@ We installed TensorFLow in R on Ubuntu 16.04 using the following command:
`install_tensorflow(version="gpu") 
`Note that the installation does not support Python 3 at the time of writing this book.
1. 安装 keras 包:
1. 安装 Keras 包:
```r
devtools::install_github("rstudio/keras")
......@@ -127,7 +127,7 @@ datasets <- tf$contrib$learn$datasets
mnist <- datasets$mnist$read_data_sets("MNIST-data", one_hot = TRUE)
```
数据从 TensorFlow 数据集库加载,并已标准化为[0,1]范围。
数据从 TensorFlow 数据集库加载,并已标准化为`[0, 1]`范围。
1. 定义模型:
......@@ -181,7 +181,7 @@ Test accuracy: 0.9185
太酷了!
[通过此链接查找 R 中 TF Core 的更多示例](https://tensorflow.rstudio.com/tensorflow/articles/examples/)
[通过此链接查找 R 中 TF 核心的更多示例](https://tensorflow.rstudio.com/tensorflow/articles/examples/)
[有关`tensorflow` R 包的更多文档可以在此链接中找到](https://tensorflow.rstudio.com/tensorflow/reference/)
......@@ -270,7 +270,7 @@ mnist$train$x <- mnist$train$x / 255
mnist$test$x <- mnist$test$x / 255
```
从下载的 gzip 文件中读取数据,然后归一化以落入[0,1]范围。
从下载的 gzip 文件中读取数据,然后归一化以落入`[0, 1]`范围。
1. 定义模型:
......@@ -366,7 +366,7 @@ y_train <- to_categorical(y_train, num_classes)
y_test <- to_categorical(y_test, num_classes)
```
注释是不言自明的:数据从 Keras 数据集库加载,然后转换为 2D arrray 并归一化为[0,1]范围。
注释是不言自明的:数据从 Keras 数据集库加载,然后转换为 2D 数组并归一化为`[0, 1]`范围。
1. 定义模型:
......@@ -449,7 +449,7 @@ Test accuracy: 0.9816
太酷!!
[在此链接中查找更多关于 Keras in R 的示例](https://keras.rstudio.com/articles/examples/index.html)
[在此链接中查找更多关于 R 中的 Keras 的示例](https://keras.rstudio.com/articles/examples/index.html)
[有关 Keras R 软件包的更多文档可在此链接中找到](https://keras.rstudio.com/reference/index.html)
......@@ -503,7 +503,7 @@ Started TensorBoard at http://127.0.0.1:4233
TensorBoard 计算图的可视化有关 R 中 TensorBoard 的更多文档,[请访问此链接](https://tensorflow.rstudio.com/tools/tensorboard.html)
# R 中的 tfruns
# R 中的`tfruns`
您可以按照 Jupyter R 笔记本中的代码`ch-17d_TensorBoard_in_R`
......@@ -532,7 +532,7 @@ training_run('mnist_model.R')
# 总结
在本章中,我们学习了如何在 R 中使用 TensorFlow Core,TensorFlow Estimators 和 Keras 包来构建和训练机器学习模型。我们提供了来自 RStudio 的 MNIST 示例的演练,并提供了有关 TensorFlow 和 Keras R 软件包的进一步文档的链接。我们还学习了如何使用 R 中的可视化工具 TensorBoard。我们还介绍了一个来自 R Studio 的新工具`tfruns`,它允许您为多次运行创建报告,分析和比较它们,并在本地保存或发布它们。
在本章中,我们学习了如何在 R 中使用 TensorFlow 核心,TensorFlow 估计器和 Keras 包来构建和训练机器学习模型。我们提供了来自 RStudio 的 MNIST 示例的演练,并提供了有关 TensorFlow 和 Keras R 软件包的进一步文档的链接。我们还学习了如何使用 R 中的可视化工具 TensorBoard。我们还介绍了一个来自 R Studio 的新工具`tfruns`,它允许您为多次运行创建报告,分析和比较它们,并在本地保存或发布它们。
直接在 R 中工作的能力很有用,因为大量的生产数据科学和机器学习代码是使用 R 编写的,现在您可以将 TensorFlow 集成到相同的代码库中并在 R 环境中运行它。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册