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

Fetch Tensor of Samples before MonteCarlo Integration #15

Open
EpsDel opened this issue Aug 8, 2019 · 0 comments
Open

Fetch Tensor of Samples before MonteCarlo Integration #15

EpsDel opened this issue Aug 8, 2019 · 0 comments

Comments

@EpsDel
Copy link

EpsDel commented Aug 8, 2019

When calling the reconstruct function in vae.py it only returns a single (averaged) value, the reconstruction of the input. Is it possible to access the reconstructions before the averaging is done? I want to have the reconstruction for each sampled latent variable separately.

Looking at the reconstruct function:

   def reconstruct(self, x, n_z=None, n_x=None):
    """
    Sample reconstructed `x` from :math:`p(x|h(z))`, where `z` is (are)
    sampled from :math:`q(z|h(x))` using the specified observation `x`.

    Args:
        x: The observation `x` for :math:`q(z|h(x))`.
        n_z: Number of intermediate `z` samples to take for each input `x`.
        n_x: Number of reconstructed `x` samples to take for each `z`.

    Returns:
        StochasticTensor: The reconstructed samples `x`.
    """
    with tf.name_scope('VAE.reconstruct'):
        q_net = self.variational(x, n_z=n_z)
        model = self.model(z=q_net['z'], n_z=n_z, n_x=n_x)
        return model['x']

Could this be done from here?

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

1 participant