Re:从零开始的机器学习 - Encoder-Decoder架构

前言

最近在学习Adaptive Style Transfer并进行工程化实践,顺便总结一下深度学习中的Encoder-Decoder Architecture。算法

正文

Encoder-Decoder(编码-解码)是深度学习中很是常见的一个模型框架,一个encoder是一个接收输入,输出特征向量的网络(FC, CNN, RNN, etc)。这些特征向量其实就是输入的特征和信息的另外一种表示。网络

编码实际上就是对内容的另外一种表示框架

decoder一样也是一个网络(一般与编码器相同的网络结构,但方向相反),它从编码器获取特征向量,并输出与实际输入或预期输出最近似的结果,好比下图 机器学习

准确的说,Encoder-Decoder并非一个具体的模型,而是一类框架。Encoder和Decoder部分能够是任意的文字,语音,图像,视频数据,模型能够采用CNN,RNN,BiRNN、LSTM、GRU等等。因此基于Encoder-Decoder,咱们能够设计出各类各样的应用算法。函数

encoder使用decoder进行训练,而且没有label(无监督)。损失函数中包含实际输入(actual input)和重构输入(reconstructed input)之间的差别(delta)。学习

一旦通过训练,encoder将给出输入的特征向量,解码器可使用该特征重构输入。this

这种技术被用于很是多不一样的应用中,好比翻译、生成模型(generative models)等。编码

不过一般应用都不会从新构建原有的输入,而是 map/translate/associate 输入至特定的输出。好比把法语翻译成英语等。.net

具体例子

Autoencoder

自动编码器神经网络是一种无监督机器学习算法、有三层的神经网络:输入层、隐藏层(编码层)和解码层。该网络的目的是重构其输入,使其隐藏层学习到该输入的良好表征。其应用了反向传播,可将目标值设置成与输入值相等。自动编码器属于无监督预训练网络(Unsupervised Pretained Networks)的一种。其结构以下图所示:翻译

[图片来源:深度学习:自动编码器基础和类型|机器之心]
好比2018年比较火的 Wasserstein自编码器。

CNN

In a CNN, an encoder-decoder network typically looks like this (a CNN encoder and a CNN decoder):

This is a network to perform semantic segmentation of an image. The left half of the network maps raw image pixels to a rich representation of a collection of feature vectors. The right half of the network takes these features, produces an output and maps the output back into the “raw” format (in this case, image pixels).

RNN

In an RNN, an encoder-decoder network typically looks like this (an RNN encoder and an RNN decoder):

This is a network to predict responses for incoming emails. The left half of the network encodes the email into a feature vector, and the right half of the network decodes the feature vector to produce word predictions.

Adaptive Style transfer

后记

参考资料

中文一个指导性文章 blog.csdn.net/xbinworld/a…

机器之心的 www.jiqizhixin.com/graph/techn…

What is an Encoder/Decoder in Deep Learning? www.quora.com/What-is-an-…

Is there a difference between autoencoders and encoder-decoder in deep learning? www.quora.com/Is-there-a-…

相关文章
相关标签/搜索