question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reparametrization in VGAE model can cause NAN's

See original GitHub issue

❓ Questions & Help

While, the implementation of the reparametrization is clean and conventional it can potentially lead to NaN's as the self.__logvar__ term is not controlled. This behavior is dependent on the use case, and for the most part will not cause problems for many applications but I believe a better fix could be something like to add another line after : https://github.com/rusty1s/pytorch_geometric/blob/master/torch_geometric/nn/models/autoencoder.py#L231

 self.__logvar__ = torch.clamp(self.__logvar__,min=LOG_VAR_MIN,max=LOG_VAR_MAX)

Where, LOG_VAR_MIN and LOG_VAR_MAX are suitable constants. This prevents numerical issues (underflow/overflow) that can happen during optimization.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Jul 11, 2019

Added to master. Thank you!

0reactions
joeybosecommented, Jul 11, 2019

Small correction LOG_VAR_MAX=20 blows up still so a lower value like 10 is more stable. But other than that everything is as you predicted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reparametrization in VGAE model can cause NAN's #500
Questions & Help While, the implementation of the reparametrization is clean and conventional it can potentially lead to NaN's as the self.
Read more >
How does the reparameterization trick for VAEs work and why ...
Intuitively, in its original form, VAEs sample from a random node z which is approximated by the parametric model q(z∣ϕ,x) of the true...
Read more >
A Reparameterization Multifeature Fusion CNN for ...
Aiming at arrhythmia heartbeats classification, a novel multifeature fusion deep learning-based method is proposed.
Read more >
Getting Nan values after first ietration - autograd
Hi, I am performing multilabel classification task. I am implementing the concept of Graph Variational Autoencoders.
Read more >
Variational Graph Author Topic Modeling
In this paper, we will extend VGAE as a topic model and incor- porate auxiliary authorship A and publication venues V. Definition 3.2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found