Skip to content

Code Problem #10

Description

@qiushuigongchang

hi, i saw the ‘finetune_t’ parameter in model.py (self.log_inv_t = torch.nn.Parameter(torch.tensor(1.0 / args.t).log(), requires_grad=args.finetune_t), in line 31), but i only find 'finetune-t' this parameter, Are the two parameters the same?

Activity

  1. intfloat commented on Oct 23, 2022

    @intfloat
    Owner

    Yes, they are the same.

  2. qiushuigongchang commented on Oct 23, 2022

    @qiushuigongchang
    Author

    Thanks a lot!

  3. qiushuigongchang commented on Oct 29, 2022

    @qiushuigongchang
    Author

    hi, I'm a little confused , What does the triplet_mask do in models.py(in line 96)

  4. intfloat commented on Oct 29, 2022

    @intfloat
    Owner

    It is used to mask out false negatives during training.

    For example, given two triples in a batch (obama, instance of, politician), (biden, is, US president), default in batch negatives will treat (obama, instance of, politician) as a positive and (obama, instance of, US president) as a negative. But the latter one is in fact a correct triple. So we need to mask it out for loss computation.

  5. qiushuigongchang commented on Oct 29, 2022

    @qiushuigongchang
    Author

    Closed-world assumption (CWA) and Open-world assumption (OWA) , is it?

  6. qiushuigongchang commented on Oct 31, 2022

    @qiushuigongchang
    Author

    hi, I'm a little confused , i understand head + relation -> tail when calculating the loss function, but what mean tail -> head + relation in trainer.py(in line 161), your help was very much appreciated.

  7. intfloat commented on Oct 31, 2022

    @intfloat
    Owner

    This is simply computing contrastive loss from two directions.

    head + relation -> tail says: given a head entity and relation, which tail entity is correct?

    tail -> head + relation says: given a tail entity, which head entity + relation is correct?

    You can refer to A Simple Framework for Contrastive Learning of Visual Representations for perhaps easier understanding.

  8. qiushuigongchang commented on Oct 31, 2022

    @qiushuigongchang
    Author

    thank you for helping me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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