Skip to content

Conversation

@suhasshrinivasan
Copy link
Collaborator

We want the log probabilities of a random variable dimension by dimension when the distribution is factorized for a few cases such as density inspection. This PR adds factorized log probability computation methods in the core classes such as IndependentTrainableDistributionAdapter and also extends the idea to factorized log dets in transforms in normalizing flows and factorized elbo and iw bound in variational dequantized distributions. The functionality is lightly tested and elucidated in a jupyter notebook in notebooks/factorized_log_prob.ipynb.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator Author

@suhasshrinivasan suhasshrinivasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to rollback ELU implementation, since changing its constructor broke backwards compatibility. We would need to discuss the modification once again.

@suhasshrinivasan suhasshrinivasan changed the title Factorized log probability methods Factorized log probability methods, dtype specific eps Feb 20, 2024
@suhasshrinivasan
Copy link
Collaborator Author

In gensn/parameters.py, numerical underflow was avoided by adding a generic epsilon value of 1e-16 and this breaks at times with PyTorch's operations (I faced a numerical underflow with eigenvalue computation). It is now changed to adding a dtype specific eps (e.g. torch.finfo(torch.float32).eps) which resolves the issue and is generally a more standardized solution.

@suhasshrinivasan suhasshrinivasan changed the title Factorized log probability methods, dtype specific eps Factorized log probability method, general variational bound class Aug 13, 2024
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

Successfully merging this pull request may close these issues.

1 participant