-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
Preview and run these notebook edits with Google Colab: Notebook diffs available on ReviewNB.com. |
Reviewers added, please take a look. 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" 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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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) 定义。" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"生成器和判别器均使用 [Keras Sequential API](https://www.tensorflow.org/guide/keras#sequential_model) 定义。" | |
"生成器和判别器均使用 [Keras Sequential API](https://tensorflow.google.cn/guide/keras#sequential_model) 定义。" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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! 🚀
}, | ||
"source": [ | ||
"# 用于生成 GIF 图片\n", | ||
"!pip install -q imageio" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"!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", |
There was a problem hiding this comment.
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
I have made changes,please check @lamberta |
There was a problem hiding this 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.
PiperOrigin-RevId: 273396984
No description provided.