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

Are the vae and lstm models independent from each other? #8

Open
YingxiaoKong opened this issue Jul 23, 2021 · 2 comments
Open

Are the vae and lstm models independent from each other? #8

YingxiaoKong opened this issue Jul 23, 2021 · 2 comments

Comments

@YingxiaoKong
Copy link

Hi,

I have went through your codes and I'm still a little bit confused about the structures of theses two models (I'm not very good at reading codes, forgive me): are they independent from each other?

When I looked at the structure of the vae model, the input is the original slice window at time step t and the output is the reconstructed window at the same time step t, not the window at time step t+1, and there is no layer input or output from the lstm model. So I guess both of models are trained separately, after the vae is trained, the lstm utilizes the information from the vae and predicted the embedding window at the next time step. Is this correct? If this this correct, how to guarantee the convergence of these two models? As the lstm model relies on the performance of the vae model.

Another question is how to process the time series input to the encoder, here I saw you have used convolutional layer, I guess lstm also works?

@lin-shuyu
Copy link
Owner

Hi Yingxiao,

Thanks for your question and apologies for the late reply!

Yes, the two models are trained separately. We first train a VAE on the task of reconstructing short windows (usually of a length of 24-144 samples). After the VAE is converged, then we train a LSTM to do one-step ahead prediction for a sequence of latent codes from the VAE.

After both models are trained, then we use them together for the anomaly detection.

The convergence of the system relies on the convergence of both models. There's no guarantee on the convergence will happen, as there's no guarantee of any neural network training, but it just usually happens. I think training both models together can also work. We didn't go for this route, as we think before VAE gets a sensible embedding, the prediction task for the LSTM is not really informative. So we think it's more efficient to get VAE works and let LSTM to predict on the stable patterns that VAE has derived.

Hope this clarifies your questions.

@YingxiaoKong
Copy link
Author

YingxiaoKong commented Aug 24, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants