Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

创建定制化 Estimator #53

Merged
merged 7 commits into from
Apr 16, 2018
Merged

创建定制化 Estimator #53

merged 7 commits into from
Apr 16, 2018

Conversation

Starriers
Copy link
Contributor

@Starriers Starriers commented Apr 5, 2018

翻译完成 #3

@leviding
Copy link
Member

leviding commented Apr 9, 2018

@Starriers 失效的图,需要你去 TensorFlow 官方找图源进行替换

@luochen1992
Copy link

校对认领

@leviding
Copy link
Member

@luochen1992 ok

Let's see how to solve the Iris problem with a custom Estimator. A quick
reminder--here's the organization of the Iris model that we're trying to mimic:
让我们看看如何使用定制化 Estimator 解决 Iris 问题。
快速提醒 -- 这是我们尝试模仿虹膜模型的组织结构:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『 -- 』=>『 —— 』
多打了一个空格

本文档介绍定制化 Estimators。特别是,
本文档将演示如何创建定制化 @{tf.estimator.Estimator$Estimator} ,
@{tf.estimator.DNNClassifier$`DNNClassifier`} 在解决 Iris 问题的行为中,
它可以模拟预制的 Estimator。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

『 Iris 』=>『虹膜 』

@luochen1992
Copy link

@Starriers @leviding 校对完成

@leviding
Copy link
Member

@Starriers 调整一下吧,该是一行的就调整到一行。然后我再 Review 一遍就行了。

@leviding
Copy link
Member

@Starriers @luochen1992 有空校对下新的那个 PR 哈

@Starriers Starriers changed the title 创建定制化 Estimators 创建定制化 Estimator Apr 16, 2018
@Starriers
Copy link
Contributor Author

校对修改建议完成

@Starriers
Copy link
Contributor Author

@leviding @luochen1992

Copy link
Member

@leviding leviding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Starriers 问题太多了!!

@luochen1992 校对的时候,格式问题也要指出的。

@{tf.estimator.DNNClassifier$`DNNClassifier`} in solving the Iris problem. See
the @{$get_started/premade_estimators$Pre-Made Estimators chapter} for details
on the Iris problem.
本文档介绍定制化 Estimator。特别是,本文档将演示如何创建定制化 @{tf.estimator.Estimator$Estimator} ,@{tf.estimator.DNNClassifier$`DNNClassifier`} 在解决虹膜问题的行为中,它可以模拟预制的 Estimator。有关虹膜问题的详细信息,请参阅 @{$get_started/premade_estimators$Pre-Made Estimators chapter} 。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

段尾多了空格

</div>
<div style="text-align: center">
Pre-made and custom Estimators are all Estimators.
预制和定制化 Estimator 都是 Estimator.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

句号

dataset = dataset.shuffle(1000).repeat().batch(batch_size)

# Return the read end of the pipeline.
# 返回管道读取的结束端
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

句号

the following lines create the estimator and set the params to configure the
model. This configuration step is similar to how we configured the @{tf.estimator.DNNClassifier} in
@{$get_started/premade_estimators}.
调用者可以将 `params` 传递给 Estimator 的构造函数。任何传递给构造函数的`params` 接着都会传递给 `model_fn`。在 [`custom_estimator.py`](https://github.com/tensorflow/models/blob/master/samples/core/get_started/custom_estimator.py) 中以下几行会创建 estimator 并设置参数来配置该参数模型。此配置步骤与我们在 @{$get_started/premade_estimators} 中如何配置 @{tf.estimator.DNNClassifier} 相似。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格少了

* [Evaluate](#evaluate)
* [Train](#train)
* [定义模型](#define_the_model)
* 为每种[三种不同模式](#modes):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多了空格

@{tf.train.AdagradOptimizer} because we're mimicking the `DNNClassifier`, which
also uses `Adagrad` by default. The `tf.train` package provides many other
optimizers—feel free to experiment with them.
构建训练操作将需要一个优化器。我们将使用 @{tf.tra.AdagradOptimizer},因为我们正在模`DNNClassifier`,默认情况下也使用 `Adagrad`。 `tf.train` 包提供了许多其他优化器--可以随意使用它们。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格多了


```python
# Build 2 hidden layer DNN with 10, 10 units respectively.
# 分别用 10 个单元和 10 个单元 建立 2 个隐藏层 DNN。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格问题 + 用两个 10 单元建立有 2 个隐藏层的 DNN

Here the `params` dictionary serves the same purpose as the key-word
arguments of `DNNClassifier`; that is, the `params` dictionary lets you
configure your Estimator without modifying the code in the `model_fn`.
在这里 `params` 字典的作用与关键字相同。`DNNClassifier` 的参数; 也就是说, `params` 字典允许您在不修改 `model_fn` 中代码的情况下配置您的 Estimator。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格多了一个


* loss: The loss reported.
* 损失:损失报告。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

格式乱码

These tensorboard graphs are one of the main reasons it's important to pass a
`global_step` to your optimizer's `minimize` method. The model can't record
the x-coordinate for these graphs without it.
这些 tensorboard 是向优化的`minimize` 方法传递 `global_step` 的主要原因之一。没有它,模型就不能记录这些图的 x 坐标。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格少了


## Implement training, evaluation, and prediction {#modes}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是锚点啊,怎么能翻译呢

@leviding
Copy link
Member

leviding commented Apr 16, 2018

@Starriers @luochen1992 看看我的 修改,下次注意哈,还有什么问题吗?

@Starriers
Copy link
Contributor Author

格式问题 确实挺多的…… 一次一定注意!

@leviding leviding merged commit 516007c into xitu:zh-hans Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants