yfzhang114/AdaNPC

leak test data infromation

libo-huang opened this issue · 1 comments

It seems to take the groud truth features from all test data.

In your AdaNPC, you take all the test data with ground truth labels (e.g., the name with out datasets) as the prototypes for inference.

if 'AdaNPC' in args.adapt_algorithm and str(args.test_envs[0]) not in name:
adapted_algorithm.classifier.extend_test(z.to(device), y.to(device))

Officially, the condition and 'out' not in name should be added to avoid such leakage of test-data information.

if 'KNN' in args.adapt_algorithm and str(args.test_envs[0]) not in name and 'out' not in name:
adapted_algorithm.classifier.extend_test(z.to(device), y.to(device))

Thanks for your interest. out datasets are a part of source domains, hence the target domain data will not be leaked.