Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

input for self.final_classifier in Class Trainer contains attribute information? #1

Open
gsliuuilsg opened this issue Apr 3, 2019 · 1 comment

Comments

@gsliuuilsg
Copy link

gsliuuilsg commented Apr 3, 2019

Hi, Abhipanda4!
Thanks for sharing codes. I find something wrong about the input variables for self.final_classifier in Class Trainer. I think this classifier should't be trained by using any attribute information of unseen classes, otherwise it will violate the zero-shot learning setting. Is that so?

`

def fit_final_classifier(self, img_features, label_attr, label_idx):

    img_features = autograd.Variable(img_features.float()).to(self.device)
    label_attr = autograd.Variable(label_attr.float()).to(self.device)
    label_idx = label_idx.to(self.device)

    X_inp = self.get_conditional_input(img_features, label_attr) **# ?**
    Y_pred = self.final_classifier(X_inp)

    self.optim_final_cls.zero_grad()
    loss = self.criterion_cls(Y_pred, label_idx)
    loss.backward()
    self.optim_final_cls.step()

    return loss.item()

`

@aivision2020
Copy link

Yes, this seems very confusing to me as well. Did you make sense of it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants