自编码器AE,VAE

2019-04-16  本文已影响0人  VanJordan

从直觉的角度来阐述

Autoencoder

VAE

VAE在NLP中的应用

It is as if they were handed a dictionary, but without any explanations. Just a long list of all the words in the English language. (Not that the explanations would have helped, since those themselves are formed of the same words that have no meaning to our players yet.)

Now on thr other hand he does not wait for Bob to finish the entire sentence. Instead he gives Bob a score and feedback after every single word he predicts.
Even more crucially, Charlie tells Bob what would have been the correct word.

The trick, given the limited information flow allowed, lies in Alice encoding exactly the kind of information she thinks is surprising to Bob and letting him rely on his own language model for the rest, and also hoping that he actually uses her information in the first place.

So now with Bob being pretty decent all by himself and Alice having learned absolutely nothing yet, we risk being stuck at what is called a local maximum.

Even if they only figure out a simple code where certain code regions tell Bob that the text is a tweet, others a news article, and yet others restaurant reviews, can dramatically help Bob make better guesses about the next word.
Since Bob also doesn’t know when to actually stop his prediction, Alice might also learn to encode the length of the sentence.

Text summarisation is also a closely related discipline. Here Alice encodes a long text, and Bob has to decode it into a summary.

从模型的角度来理解(深度学习角度)

def vae_loss(input_img, output):
    # compute the average MSE error, then scale it up, ie. simply sum on all axes
    reconstruction_loss = K.sum(K.square(output-input_img))
    # compute the KL loss
    kl_loss = - 0.5 * K.sum(1 + log_stddev - K.square(mean) - K.square(K.exp(log_stddev)), axis=-1)
    # return the average loss over all images in batch
    total_loss = K.mean(reconstruction_loss + kl_loss)    
    return total_loss

从数学的角度来理解(概率模型角度理解)

其他一些零零碎碎的东西

上一篇 下一篇

猜你喜欢

热点阅读