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

why do you do evaluation before training ? #2

Open
Starry-lei opened this issue Aug 14, 2024 · 0 comments
Open

why do you do evaluation before training ? #2

Starry-lei opened this issue Aug 14, 2024 · 0 comments

Comments

@Starry-lei
Copy link

Hi ,thanks for sharing the code! I am wondering why do you do "
else:
ldj = self.log_likelihood(z)
return z, ldj
" in the following code.

if not reverse:

        ldj = z.new_zeros(batch_size, )
        z = z.reshape((batch_size, self.d_in))
        device = z.device
        print("checking z ssssshape", z.shape) # [1, 192])
        print("checking self.training ", self.training) #  False
        
        if self.training:
            t = th.randint(0, self.T, (batch_size, ), device=device).long()
            print("checking t", t)
            # loss mark
            ldj = -self.training_losses(z, t, x_cat, **kwargs)['loss']
            z = z.reshape((batch_size, set_size, hidden_dim))
            return z, ldj
        else:
            ldj = self.log_likelihood(z)

            return z, ldj

    else:
        ldj = self.nll(z)
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