Skip to content
This repository was archived by the owner on Sep 13, 2021. It is now read-only.
This repository was 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

@gsliuuilsg

Description

@gsliuuilsg

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()

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions