{"action":"created","comment":{"url":"https://api.github.com/repos/cosname/cosx.org/pulls/comments/206480689","pull_request_review_id":141340617,"id":206480689,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjQ4MDY4OQ==","diff_hunk":"@@ -0,0 +1,197 @@\n+---\n+title: 教程----什么是变分自动编码器\n+author: \n+  - 姚杰\n+  - 黄理强\n+date: '2018-06-27'\n+meta_extra: \"原作者：Jaan Altosaar；译者：姚杰，黄理强\"\n+categories:\n+  - 机器学习\n+tags:\n+  - 机器学习\n+  - 翻译\n+forum_id: \"\"\n+---\n+\n+> 本文翻译自[Jaan Altosaar的博客](https://jaan.io/what-is-variational-autoencoder-vae-tutorial/)，本文已获得原作者授权。\n+\n+> 从深度学习和图模型这两个角度来理解变分自动编码器（Variational Autoencoders，VAE）。\n+\n+为什么深度学习研究者和概率机器学习人员谈及变分自动编码器会感到困惑？什么是变分自动编码器？围绕这个名词为什么会有一些不合理的疑惑？\n+\n+这里存在着概念与语义的差异。神经网络与概率模型的学科领域之间没有共同的语言。我的目标是弥合这种思想差距，并且激发两个领域之间更多的合作和讨论，同时提供一个一致的实现。如果这里有很多词汇对你来说是新的词汇，可以跳到术语表。\n+\n+变分自动编码器很酷。它可以使得我们基于数据设计复杂的生成模型，并且在大数据集上拟合。它可以生成虚构的名人脸部图像以及高分辨率的数字艺术作品。\n+\n+![由变分自动编码器生成的虚构名人脸（作者: ALEC RADFORD）](https://jaan.io/images/variational-autoencoder-faces.jpg)\n+\n+<center>由变分自动编码器生成的虚构名人脸[作者: ALEC RADFORD](https://www.youtube.com/watch?v=XNZIN7Jh3Sg) </center>\n+\n+这些模型同时在图像生成和强化学习中也能产生最先进的机器学习结果。Kingma和Rezenda等人在2013年定义了变分自动编码器（VAEs）。\n+\n+我们如何创建一种讨论变分自动编码器的语言？让我们首先使用神经网络来思考他们，然后在概率模型中使用变分推断。\n+\n+## 神经网络角度\n+\n+在神经网络语言中，变分自动编码器由编码器，解码器和损失函数组成。\n+\n+![编码器将数据压缩成一个潜在的空间，解码器在给定隐藏表示的情况下重建数据](https://jaan.io/images/encoder-decoder.png)\n+\n+<center>编码器将数据压缩成一个潜在的空间，解码器在给定隐藏表示的情况下重建数据</center>\n+\n+该编码器是一个神经网络。它的输入是一个数据点`$x$`，它的输出是一个隐藏表示`$z$`，它有权重和偏差`$\\theta$`。具体来说，让我们假设x是28*28像素大小的手写数字照片。编码器将784维的数据压缩成一个远远小于784维的隐藏表示空间z。这通常被称为“瓶颈”，因为编码器必须学习将数据有效压缩到这个较低维空间。让我们来表示这个编码器$$q_\\theta(z∣x)$$。我们注意到，低维空间是随机的：编码器将参数输出给$$q_\\theta(z∣x)$$，该公式本身是一个高斯概率密度。我们可以从这个分布中抽样来获得表示z的嘈杂值。\n+\n+解码器是另一个神经网络。它的输入是隐藏表示z，它的输出是基于的概率分布的参数，并且具有权重和偏差$$\\phi$$。解码器用 $$p_\\phi(x∣z)$$ 表示。运行手写数字示例，照片只有黑白两色，并将每个像素表示成0或1.可以使用伯努利分布来表示单个像素的概率分布。解码器的输入是数字的隐藏表示z，输出是图像中784像素对应的784个伯努利参数。解码器将z中的实数解码成0-1之间的784个实数。由于信息从较小维度转变成较大维度，信息存在丢失。那么有多少信息丢失呢？我们利用单位为nats的重构对数似然函数 $$p_\\phi(x∣z)$$ 来衡量数据丢失。这个方法告诉我们解码器基于隐藏表示z是如何有效的重构输入图像x。\n+\n+变分自动编码器的损失函数是负对数似然函数以及正则化。因为没有全部数据点展现的全局数据展示，我们可以将损失函数分解为仅依赖于单个数据点的项li。总损失是N个数据点的总损失$$\\sum^N_{i=1} l_i$$。对于数据点xi的损失函数是：","path":"content/post/2018-06-27-what-is-variational-autoencoder-vae-tutorial-cn.md","position":46,"original_position":46,"commit_id":"f48152747718158ec64d6b16d96b1a6c6eb41737","original_commit_id":"f48152747718158ec64d6b16d96b1a6c6eb41737","user":{"login":"tomatoiscoding","id":18478302,"node_id":"MDQ6VXNlcjE4NDc4MzAy","avatar_url":"https://avatars1.githubusercontent.com/u/18478302?v=4","gravatar_id":"","url":"https://api.github.com/users/tomatoiscoding","html_url":"https://github.com/tomatoiscoding","followers_url":"https://api.github.com/users/tomatoiscoding/followers","following_url":"https://api.github.com/users/tomatoiscoding/following{/other_user}","gists_url":"https://api.github.com/users/tomatoiscoding/gists{/gist_id}","starred_url":"https://api.github.com/users/tomatoiscoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomatoiscoding/subscriptions","organizations_url":"https://api.github.com/users/tomatoiscoding/orgs","repos_url":"https://api.github.com/users/tomatoiscoding/repos","events_url":"https://api.github.com/users/tomatoiscoding/events{/privacy}","received_events_url":"https://api.github.com/users/tomatoiscoding/received_events","type":"User","site_admin":false},"body":"变分自动编码器的损失函数是带有正则化的负对数似然函数。\r\n因为不存在全部样本点可以共用的全局表示。\r\n`li`也用公式表示","created_at":"2018-07-31T10:51:41Z","updated_at":"2018-07-31T10:51:48Z","html_url":"https://github.com/cosname/cosx.org/pull/785#discussion_r206480689","pull_request_url":"https://api.github.com/repos/cosname/cosx.org/pulls/785","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cosname/cosx.org/pulls/comments/206480689"},"html":{"href":"https://github.com/cosname/cosx.org/pull/785#discussion_r206480689"},"pull_request":{"href":"https://api.github.com/repos/cosname/cosx.org/pulls/785"}}},"pull_request":{"url":"https://api.github.com/repos/cosname/cosx.org/pulls/785","id":197594657,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NTk0NjU3","html_url":"https://github.com/cosname/cosx.org/pull/785","diff_url":"https://github.com/cosname/cosx.org/pull/785.diff","patch_url":"https://github.com/cosname/cosx.org/pull/785.patch","issue_url":"https://api.github.com/repos/cosname/cosx.org/issues/785","number":785,"state":"open","locked":false,"title":"投稿：教程----什么是变分自动编码器 姚杰 黄理强","user":{"login":"yj3328935","id":13486562,"node_id":"MDQ6VXNlcjEzNDg2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/13486562?v=4","gravatar_id":"","url":"https://api.github.com/users/yj3328935","html_url":"https://github.com/yj3328935","followers_url":"https://api.github.com/users/yj3328935/followers","following_url":"https://api.github.com/users/yj3328935/following{/other_user}","gists_url":"https://api.github.com/users/yj3328935/gists{/gist_id}","starred_url":"https://api.github.com/users/yj3328935/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yj3328935/subscriptions","organizations_url":"https://api.github.com/users/yj3328935/orgs","repos_url":"https://api.github.com/users/yj3328935/repos","events_url":"https://api.github.com/users/yj3328935/events{/privacy}","received_events_url":"https://api.github.com/users/yj3328935/received_events","type":"User","site_admin":false},"body":"公式和iframe元素在preview的时候没有显示正确\r\n\r\n\r\n\r\n- 投稿者请注意\r\n  - [x] 主编审核确认接收\r\n  - [x] 主编安排审稿人\r\n  - [ ] 审稿、修改\r\n\r\n> 至此，投稿部分的工作结束\r\n\r\n- 编辑部分工作\r\n  - [ ] 文字编辑做校对工作。需校对文章分类，目前的文章分类包括：**COS访谈，R会议，R语言，推荐文章，新闻动态，机器学习，统计之都，统计图形，统计应用，统计模型，统计计算，统计软件，职业事业**。不得擅自增加分类。\r\n  - [ ] 论坛帖子负责人发帖，粘贴链接，隐藏帖子后提供 `forum_id` 加入文章\r\n  - [ ] 微信编辑、发布，阅读原文附主站链接，文末附作者介绍\r\n  - [ ] 合并 PR，发布文章\r\n  - [ ] 论坛帖子负责人帖子取消隐藏\r\n\r\n[投稿指南在这里](https://cosx.org/contribute/)，有任何问题，可以直接在PR留言，其他问题请联系: editor@cos.name。\r\n","created_at":"2018-06-27T01:39:05Z","updated_at":"2018-07-31T10:51:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"def0e07e873b568fd382a10af9e8fd6ab8d1204f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cosname/cosx.org/pulls/785/commits","review_comments_url":"https://api.github.com/repos/cosname/cosx.org/pulls/785/comments","review_comment_url":"https://api.github.com/repos/cosname/cosx.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cosname/cosx.org/issues/785/comments","statuses_url":"https://api.github.com/repos/cosname/cosx.org/statuses/f48152747718158ec64d6b16d96b1a6c6eb41737","head":{"label":"yj3328935:patch-1","ref":"patch-1","sha":"f48152747718158ec64d6b16d96b1a6c6eb41737","user":{"login":"yj3328935","id":13486562,"node_id":"MDQ6VXNlcjEzNDg2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/13486562?v=4","gravatar_id":"","url":"https://api.github.com/users/yj3328935","html_url":"https://github.com/yj3328935","followers_url":"https://api.github.com/users/yj3328935/followers","following_url":"https://api.github.com/users/yj3328935/following{/other_user}","gists_url":"https://api.github.com/users/yj3328935/gists{/gist_id}","starred_url":"https://api.github.com/users/yj3328935/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yj3328935/subscriptions","organizations_url":"https://api.github.com/users/yj3328935/orgs","repos_url":"https://api.github.com/users/yj3328935/repos","events_url":"https://api.github.com/users/yj3328935/events{/privacy}","received_events_url":"https://api.github.com/users/yj3328935/received_events","type":"User","site_admin":false},"repo":{"id":138813547,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg4MTM1NDc=","name":"cosx.org","full_name":"yj3328935/cosx.org","owner":{"login":"yj3328935","id":13486562,"node_id":"MDQ6VXNlcjEzNDg2NTYy","avatar_url":"https://avatars1.githubusercontent.com/u/13486562?v=4","gravatar_id":"","url":"https://api.github.com/users/yj3328935","html_url":"https://github.com/yj3328935","followers_url":"https://api.github.com/users/yj3328935/followers","following_url":"https://api.github.com/users/yj3328935/following{/other_user}","gists_url":"https://api.github.com/users/yj3328935/gists{/gist_id}","starred_url":"https://api.github.com/users/yj3328935/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yj3328935/subscriptions","organizations_url":"https://api.github.com/users/yj3328935/orgs","repos_url":"https://api.github.com/users/yj3328935/repos","events_url":"https://api.github.com/users/yj3328935/events{/privacy}","received_events_url":"https://api.github.com/users/yj3328935/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yj3328935/cosx.org","description":"统计之都主站","fork":true,"url":"https://api.github.com/repos/yj3328935/cosx.org","forks_url":"https://api.github.com/repos/yj3328935/cosx.org/forks","keys_url":"https://api.github.com/repos/yj3328935/cosx.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yj3328935/cosx.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yj3328935/cosx.org/teams","hooks_url":"https://api.github.com/repos/yj3328935/cosx.org/hooks","issue_events_url":"https://api.github.com/repos/yj3328935/cosx.org/issues/events{/number}","events_url":"https://api.github.com/repos/yj3328935/cosx.org/events","assignees_url":"https://api.github.com/repos/yj3328935/cosx.org/assignees{/user}","branches_url":"https://api.github.com/repos/yj3328935/cosx.org/branches{/branch}","tags_url":"https://api.github.com/repos/yj3328935/cosx.org/tags","blobs_url":"https://api.github.com/repos/yj3328935/cosx.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yj3328935/cosx.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yj3328935/cosx.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/yj3328935/cosx.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yj3328935/cosx.org/statuses/{sha}","languages_url":"https://api.github.com/repos/yj3328935/cosx.org/languages","stargazers_url":"https://api.github.com/repos/yj3328935/cosx.org/stargazers","contributors_url":"https://api.github.com/repos/yj3328935/cosx.org/contributors","subscribers_url":"https://api.github.com/repos/yj3328935/cosx.org/subscribers","subscription_url":"https://api.github.com/repos/yj3328935/cosx.org/subscription","commits_url":"https://api.github.com/repos/yj3328935/cosx.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/yj3328935/cosx.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/yj3328935/cosx.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/yj3328935/cosx.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/yj3328935/cosx.org/contents/{+path}","compare_url":"https://api.github.com/repos/yj3328935/cosx.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yj3328935/cosx.org/merges","archive_url":"https://api.github.com/repos/yj3328935/cosx.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yj3328935/cosx.org/downloads","issues_url":"https://api.github.com/repos/yj3328935/cosx.org/issues{/number}","pulls_url":"https://api.github.com/repos/yj3328935/cosx.org/pulls{/number}","milestones_url":"https://api.github.com/repos/yj3328935/cosx.org/milestones{/number}","notifications_url":"https://api.github.com/repos/yj3328935/cosx.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yj3328935/cosx.org/labels{/name}","releases_url":"https://api.github.com/repos/yj3328935/cosx.org/releases{/id}","deployments_url":"https://api.github.com/repos/yj3328935/cosx.org/deployments","created_at":"2018-06-27T01:29:31Z","updated_at":"2018-06-27T01:29:35Z","pushed_at":"2018-07-29T09:29:36Z","git_url":"git://github.com/yj3328935/cosx.org.git","ssh_url":"git@github.com:yj3328935/cosx.org.git","clone_url":"https://github.com/yj3328935/cosx.org.git","svn_url":"https://github.com/yj3328935/cosx.org","homepage":"https://cosx.org","size":6085,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cosname:master","ref":"master","sha":"8c78fc19be2f03a74805cf946d2cc7fbfb45c3b4","user":{"login":"cosname","id":529133,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyOTEzMw==","avatar_url":"https://avatars0.githubusercontent.com/u/529133?v=4","gravatar_id":"","url":"https://api.github.com/users/cosname","html_url":"https://github.com/cosname","followers_url":"https://api.github.com/users/cosname/followers","following_url":"https://api.github.com/users/cosname/following{/other_user}","gists_url":"https://api.github.com/users/cosname/gists{/gist_id}","starred_url":"https://api.github.com/users/cosname/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosname/subscriptions","organizations_url":"https://api.github.com/users/cosname/orgs","repos_url":"https://api.github.com/users/cosname/repos","events_url":"https://api.github.com/users/cosname/events{/privacy}","received_events_url":"https://api.github.com/users/cosname/received_events","type":"Organization","site_admin":false},"repo":{"id":85083667,"node_id":"MDEwOlJlcG9zaXRvcnk4NTA4MzY2Nw==","name":"cosx.org","full_name":"cosname/cosx.org","owner":{"login":"cosname","id":529133,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyOTEzMw==","avatar_url":"https://avatars0.githubusercontent.com/u/529133?v=4","gravatar_id":"","url":"https://api.github.com/users/cosname","html_url":"https://github.com/cosname","followers_url":"https://api.github.com/users/cosname/followers","following_url":"https://api.github.com/users/cosname/following{/other_user}","gists_url":"https://api.github.com/users/cosname/gists{/gist_id}","starred_url":"https://api.github.com/users/cosname/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosname/subscriptions","organizations_url":"https://api.github.com/users/cosname/orgs","repos_url":"https://api.github.com/users/cosname/repos","events_url":"https://api.github.com/users/cosname/events{/privacy}","received_events_url":"https://api.github.com/users/cosname/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cosname/cosx.org","description":"统计之都主站","fork":false,"url":"https://api.github.com/repos/cosname/cosx.org","forks_url":"https://api.github.com/repos/cosname/cosx.org/forks","keys_url":"https://api.github.com/repos/cosname/cosx.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cosname/cosx.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cosname/cosx.org/teams","hooks_url":"https://api.github.com/repos/cosname/cosx.org/hooks","issue_events_url":"https://api.github.com/repos/cosname/cosx.org/issues/events{/number}","events_url":"https://api.github.com/repos/cosname/cosx.org/events","assignees_url":"https://api.github.com/repos/cosname/cosx.org/assignees{/user}","branches_url":"https://api.github.com/repos/cosname/cosx.org/branches{/branch}","tags_url":"https://api.github.com/repos/cosname/cosx.org/tags","blobs_url":"https://api.github.com/repos/cosname/cosx.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cosname/cosx.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cosname/cosx.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/cosname/cosx.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cosname/cosx.org/statuses/{sha}","languages_url":"https://api.github.com/repos/cosname/cosx.org/languages","stargazers_url":"https://api.github.com/repos/cosname/cosx.org/stargazers","contributors_url":"https://api.github.com/repos/cosname/cosx.org/contributors","subscribers_url":"https://api.github.com/repos/cosname/cosx.org/subscribers","subscription_url":"https://api.github.com/repos/cosname/cosx.org/subscription","commits_url":"https://api.github.com/repos/cosname/cosx.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/cosname/cosx.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/cosname/cosx.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/cosname/cosx.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/cosname/cosx.org/contents/{+path}","compare_url":"https://api.github.com/repos/cosname/cosx.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cosname/cosx.org/merges","archive_url":"https://api.github.com/repos/cosname/cosx.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cosname/cosx.org/downloads","issues_url":"https://api.github.com/repos/cosname/cosx.org/issues{/number}","pulls_url":"https://api.github.com/repos/cosname/cosx.org/pulls{/number}","milestones_url":"https://api.github.com/repos/cosname/cosx.org/milestones{/number}","notifications_url":"https://api.github.com/repos/cosname/cosx.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cosname/cosx.org/labels{/name}","releases_url":"https://api.github.com/repos/cosname/cosx.org/releases{/id}","deployments_url":"https://api.github.com/repos/cosname/cosx.org/deployments","created_at":"2017-03-15T14:41:00Z","updated_at":"2018-07-27T06:56:49Z","pushed_at":"2018-07-30T17:19:31Z","git_url":"git://github.com/cosname/cosx.org.git","ssh_url":"git@github.com:cosname/cosx.org.git","clone_url":"https://github.com/cosname/cosx.org.git","svn_url":"https://github.com/cosname/cosx.org","homepage":"https://cosx.org","size":6081,"stargazers_count":71,"watchers_count":71,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":120,"open_issues":56,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cosname/cosx.org/pulls/785"},"html":{"href":"https://github.com/cosname/cosx.org/pull/785"},"issue":{"href":"https://api.github.com/repos/cosname/cosx.org/issues/785"},"comments":{"href":"https://api.github.com/repos/cosname/cosx.org/issues/785/comments"},"review_comments":{"href":"https://api.github.com/repos/cosname/cosx.org/pulls/785/comments"},"review_comment":{"href":"https://api.github.com/repos/cosname/cosx.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cosname/cosx.org/pulls/785/commits"},"statuses":{"href":"https://api.github.com/repos/cosname/cosx.org/statuses/f48152747718158ec64d6b16d96b1a6c6eb41737"}},"author_association":"NONE"}}
{"actor":{"display_login":"tomatoiscoding"}}