JudyYe / zero-shot-gcn

Zero-Shot Learning with GCN (CVPR 2018)
MIT License
917 stars 178 forks source link

Some questions about loss funtion? #20

Closed zehuanzhang closed 4 years ago

zehuanzhang commented 4 years ago

Thanks for sharing codes. I would ask :

the code in models.py line189:

def _loss(self):
    # Weight decay loss
    for i in range(len(self.layers)):
        for var in self.layers[i].vars.values():
            self.loss += FLAGS.weight_decay * tf.nn.l2_loss(var)

    # Cross entropy error
    self.loss += mask_mse_loss(self.outputs, tf.nn.l2_normalize(self.placeholders['labels'], dim=1),
                               self.placeholders['labels_mask'])

self.placeholders['labels'] I thought that it should calculate loss using weights (or features of images). Here it uses labels? why?

Thanks for answers! Really thank you!

JudyYe commented 4 years ago

Hey!

Thanks for reaching out. 'label' refers to the weight of each class -- not features of images nor one-hot vector. (It's been a while so please ping me if I'm wrong) Thanks.