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

Problem with PT_Part2_Debiasing_Solution #173

Open
yiwenwangANU opened this issue Feb 10, 2025 · 0 comments
Open

Problem with PT_Part2_Debiasing_Solution #173

yiwenwangANU opened this issue Feb 10, 2025 · 0 comments

Comments

@yiwenwangANU
Copy link

The solution you provide in "Defining the DB-VAE loss function" part might be wrong:

total_loss = torch.mean(classification_loss * face_indicator + vae_loss)

From your definition, for images of non-faces, loss function is solely the classification loss, so it should be

total_loss = torch.mean(classification_loss  + vae_loss * face_indicator)

btw, why we use the training data as testing data in the first CNN model? I don't have api for your loader, but if I am right, that loader.get_batch(5000)should already been used during training?

# set the model to eval mode
standard_classifier.eval()

# TRAINING DATA
# Evaluate on a subset of CelebA+Imagenet
(batch_x, batch_y) = loader.get_batch(5000)
batch_x = torch.from_numpy(batch_x).float().to(device)
batch_y = torch.from_numpy(batch_y).float().to(device)

with torch.inference_mode():
    y_pred_logits = standard_classifier(batch_x)
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