edgarschnfld / CADA-VAE-PyTorch

Official implementation of the paper "Generalized Zero- and Few-Shot Learning via Aligned Variational Autoencoders" (CVPR 2019)
MIT License
283 stars 57 forks source link

Question about the input of attribute #14

Closed pipi9baby closed 4 years ago

pipi9baby commented 4 years ago

I found that you use 'att' to be the input of E1 not 'original_att'. what the difference between 'att' and 'original_att'?

edgarschnfld commented 4 years ago

Each class attribute vector is normalized to have the unit l2 norm. So att is the normalized version of original_att.

edgarschnfld commented 4 years ago

Further clarification: The line

self.aux_data = torch.from_numpy(matcontent['att'].T).float().to(self.device)

would be equivalent to:

self.aux_data = torch.from_numpy(matcontent['original_att'].T).float().to(self.device)
self.aux_data = torch.nn.functional.normalize(self.aux_data, p=2, dim=1)