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

zh-CN: tutorials/generative/dcgan.ipynb #1072

Merged
merged 6 commits into from
Oct 7, 2019

Conversation

Berrywrq
Copy link
Contributor

@Berrywrq Berrywrq commented Oct 2, 2019

No description provided.

@tfdocsbot
Copy link
Collaborator

Preview and run these notebook edits with Google Colab:

Notebook diffs available on ReviewNB.com.

@tfdocsbot tfdocsbot added translation Community-provided translation for certain languages zh-cn labels Oct 2, 2019
@googlebot googlebot added the cla: yes CLA has been signed label Oct 2, 2019
@tfdocsbot
Copy link
Collaborator

Reviewers added, please take a look.
@kuri-leo, @JayYip, @yantaozhao, @loveunk, @Wind2esg, @tigerneil, @MofiiTech, @gaoljhy, @Mr-Linus, @flopsySong, @echosun1996

When your review is finished, approve the pull request or include "LGTM" in your comment.

" model.add(layers.LeakyReLU())\n",
"\n",
" model.add(layers.Reshape((7, 7, 256)))\n",
" assert model.output_shape == (None, 7, 7, 256) # Note: None is the batch size\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
" assert model.output_shape == (None, 7, 7, 256) # Note: None is the batch size\n",
" assert model.output_shape == (None, 7, 7, 256) # 注意: batch size 没有限制\n",

"\n",
"[生成对抗网络](https://arxiv.org/abs/1406.2661)(GANs)是当今计算机科学领域最有趣的想法之一。两个模型通过对抗过程同时训练。一个*生成器*(“艺术家”)学习创造看起来真实的图像,而*判别器*(“艺术评论家”)学习区分真假图像。\n",
"\n",
"![生成器和判别器图示](./images/gan1.png)\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Excuse me, does the path here need us to modify it? @lamberta

Copy link
Member

Choose a reason for hiding this comment

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

Relative path should stay the same.
On tensorflow.org, it will first check if the file exists in the language directory, then will fall back to English.
Though it does mean some broken image links when previewing notebooks on GitHub, unfortunately.

"outputs": [],
"source": [
"train_images = train_images.reshape(train_images.shape[0], 28, 28, 1).astype('float32')\n",
"train_images = (train_images - 127.5) / 127.5 # Normalize the images to [-1, 1]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"train_images = (train_images - 127.5) / 127.5 # Normalize the images to [-1, 1]"
"train_images = (train_images - 127.5) / 127.5 # 将图像规格化为 [-1, 1]"

"source": [
"## 创建模型\n",
"\n",
"生成器和判别器均使用 [Keras Sequential API](https://www.tensorflow.org/guide/keras#sequential_model) 定义。"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"生成器和判别器均使用 [Keras Sequential API](https://www.tensorflow.org/guide/keras#sequential_model) 定义。"
"生成器和判别器均使用 [Keras Sequential API](https://tensorflow.google.cn/guide/keras#sequential_model) 定义。"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks,I have made changes, please check again

Copy link
Contributor

@Mr-Linus Mr-Linus left a comment

Choose a reason for hiding this comment

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

LGTM

@tfdocsbot tfdocsbot added kokoro:force-run lgtm Community-added approval labels Oct 4, 2019
Copy link
Member

@lamberta lamberta left a comment

Choose a reason for hiding this comment

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

Thanks for the translation and review! 🚀

@lamberta lamberta added ready to pull Start merge process and removed ready to pull Start merge process labels Oct 4, 2019
},
"source": [
"# 用于生成 GIF 图片\n",
"!pip install -q imageio"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"!pip install -q imageio"
"!pip install imageio"

Remove -q from pip install

"\n",
"[生成对抗网络](https://arxiv.org/abs/1406.2661)(GANs)是当今计算机科学领域最有趣的想法之一。两个模型通过对抗过程同时训练。一个*生成器*(“艺术家”)学习创造看起来真实的图像,而*判别器*(“艺术评论家”)学习区分真假图像。\n",
"\n",
"![生成器和判别器图示](https://github.com/Berrywrq/docs/blob/master/site/zh-cn/tutorials/generative/images/gan1.png?raw=1)\n",
Copy link
Member

Choose a reason for hiding this comment

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

Please don't link to your personal github repo.

Perhaps link to the en/ version: https://github.com/tensorflow/docs/blob/master/site/en/tutorials/generative/images/gan1.png

site/zh-cn/tutorials/generative/dcgan.ipynb Outdated Show resolved Hide resolved
@lamberta lamberta added the awaiting-contributor-response Indicates a question, draft, or work-in-progress label Oct 4, 2019
@Berrywrq
Copy link
Contributor Author

Berrywrq commented Oct 5, 2019

I have made changes,please check @lamberta

@lamberta lamberta removed the awaiting-contributor-response Indicates a question, draft, or work-in-progress label Oct 7, 2019
Copy link
Member

@lamberta lamberta left a comment

Choose a reason for hiding this comment

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

Thanks!
Looks like the GItHub URL still required the raw=1 URL param so I went ahead and added it.

@lamberta lamberta added the ready to pull Start merge process label Oct 7, 2019
TensorFlow-Docs-Copybara pushed a commit that referenced this pull request Oct 7, 2019
PiperOrigin-RevId: 273396984
@TensorFlow-Docs-Copybara TensorFlow-Docs-Copybara merged commit 1219ba8 into tensorflow:master Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA has been signed lgtm Community-added approval ready to pull Start merge process translation Community-provided translation for certain languages zh-cn
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants