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

More consistent Tensorflow chains #8

Open
williamjameshandley opened this issue Jul 22, 2022 · 1 comment
Open

More consistent Tensorflow chains #8

williamjameshandley opened this issue Jul 22, 2022 · 1 comment

Comments

@williamjameshandley
Copy link
Collaborator

Whilst working on #7, it became clear that we are using multiple versions of normal transformations, tensorflow bijector chains, scaling and uniform distribution quantiles.

This should ideally be more unified, so that at least we are using the same functions for transformations (rather than tensorflow_probability.distribution functions and tensorflow_probability.bijector functions), but even better would be to include the pre-processing _forward_transform and _inverse_transform as part of the full bijector chain.

@htjb
Copy link
Owner

htjb commented Oct 10, 2023

Okay so been a while since this issue was opened and the code has changed a bit but the _forward_transform and _inverse_transform functions still form an integral part of the code. A more consistent way to incorporate the gaussianization of the data (see figure 2 in this paper) that these functions perform is to define

self.bij = tfb.Chain([tfb.Shift(self.theta_min), 
                              tfb.Scale(self.theta_max-self.theta_min), 
                               tfb.NormalCDF(),
            *[tfb.MaskedAutoregressiveFlow(made) for made in self.mades]])

for the maf. We can then remove the normalisation step for theta in _training I think. This needs testing and I still need to work out what to do with the log probability and sampling but I will try and look into it.

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