提交 a888957f 编写于 作者: W wizardforcel

2020-08-05 21:32:00

上级 b72b5065
......@@ -12,11 +12,11 @@ TensorFlow 是 Google 最近发布的新的机器学习和图计算库。 其 Py
## TensorFlow 主页
首先,什么是 TensorFlow? TensorFlow 是 Google 推出的新的机器学习库。 它被设计为非常易于使用且非常快。 如果您访问[ TensorFlow 网站](http://tensorflow.org),则可以访问有关 TensorFlow 是什么以及如何使用的大量信息。 我们将经常提到这一点,特别是文档。
首先,什么是 TensorFlow? TensorFlow 是 Google 推出的新的机器学习库。 它被设计为非常易于使用且非常快。 如果您访问 [TensorFlow 网站](http://tensorflow.org),则可以访问有关 TensorFlow 是什么以及如何使用的大量信息。 我们将经常提到这一点,特别是文档。
## TensorFlow 安装页面
在我们开始使用 TensorFlow 之前,请注意,您需要先安装它,因为它可能尚未预先安装在您的操作系统上。 因此,如果转到 TensorFlow 网页上的“安装”选项卡,单击在 Ubuntu 上安装 TensorFlow,然后单击“本机” pip,您将学习如何安装 TensorFlow。
在我们开始使用 TensorFlow 之前,请注意,您需要先安装它,因为它可能尚未预先安装在您的操作系统上。 因此,如果转到 TensorFlow 网页上的“安装”选项卡,单击在 Ubuntu 上安装 TensorFlow,然后单击“本机 PIP”,您将学习如何安装 TensorFlow。
![TensorFlow – the installation page](img/00002.jpg)
......@@ -395,7 +395,7 @@ William H. Greene 的《计量经济学分析》(Pearson)于 2012 年出版
## 准备数据
在 TensorFlow 中实现逻辑回归非常容易,并将作为更复杂的机器学习算法的基础。 首先,我们需要将整数标签转换为单格式。 这意味着,不是将字体类标记为 2,而是将标签转换为[0,0,1,0,0]。 也就是说,我们将`1`放在第二个位置(注意,向上计数在计算机科学中很常见),而`0`则放在其他位置。 这是我们的`to_onehot`函数的代码:
在 TensorFlow 中实现逻辑回归非常容易,并将作为更复杂的机器学习算法的基础。 首先,我们需要将整数标签转换为单格式。 这意味着,不是将字体类标记为 2,而是将标签转换为`[0, 0, 1, 0, 0]`。 也就是说,我们将`1`放在第二个位置(注意,向上计数在计算机科学中很常见),而`0`则放在其他位置。 这是我们的`to_onehot`函数的代码:
```py
def to_onehot(labels,nclasses = 5):
......
......@@ -143,7 +143,7 @@ except ImportError:
b1 = tf.Variable(tf.constant(0.1,shape=[num_hidden]))
```
3. The way we compute the activation function of the weighted sum is with the single `h1` line; this is to multiply our input pixels by their respective weights for each neuron:
3. 我们计算加权和的激活函数的方法是使用单行`h1`。 这是将我们的输入像素乘以每个神经元各自的权重:
```py
h1 = tf.sigmoid(tf.matmul(x,W1) + b1)
......@@ -153,7 +153,7 @@ except ImportError:
![Exploring the single hidden layer model](img/00028.jpg)
4. Now it's just your friendly logistic regression again; you already know what to do. These newly computed 128 features need their own set of weights and biases to compute a score on the output class, that's `W2` and `b2`, respectively. Note how the shape matches the shape of the neurons 128, and the number of the output class is `5`:
4. 现在,这只是对您友好的逻辑回归; 您已经知道该怎么办。 这些新计算的 128 个特征需要它们自己的权重和偏置集来计算输出类的分数,分别为`W2``b2`。 注意形状如何与神经元的形状 128 匹配,并且输出类的数量 为 5:
```py
W2 = tf.Variable(tf.truncated_normal([num_hidden, 5],
......
......@@ -276,19 +276,19 @@ TensorFlow 不断更新。 尽管它不是 Google 的正式产品,但它还是
最后,无论大小,其他公司都在使用 TensorFlow。 现在您是 TensorFlow 的从业人员,唯一的限制就是您可能遇到的问题和您的计算资源。 以下是一些有关 TensorFlow 下一步可以解决的问题的想法:
* Leaf classification from images:
* 图像中的叶子分类:
像字体一样,植物叶子在一个物种中具有相似的样式。 您是否可以修改在本课程中建立的模型,以仅使用图像识别物种?
* Road sign identification with dashcam video:
* 带有行车记录仪视频的路标识别:
假设您从长途旅行中获得了许多行车记录仪镜头。 高速公路上的路标可以为您提供许多信息,例如您在哪里以及应该走多快。 您可以建立一系列 TensorFlow 模型来查找素材中的速度限制吗?
* Transportation research predicting travel times:
* 预测出行时间的运输研究:
此外,无论您的工作距离有多近,通勤时间都太长。 在交通和天气等当前条件下,您应该能够建立基于回归的模型来预测您的旅行时间。
* Matching algorithm, as for finding a compatible date:
* 用于查找兼容日期的匹配算法:
最后,一家初创公司正在探索使用 TensorFlow 来寻找匹配算法。 如果将来算法会给您带来一个约会,请不要感到惊讶。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册