hi ,I find a problem that your code does not match your paper,
z3_weight = cls.model_args.hard_negative_weight
weights = torch.tensor(
[[0.0] (cos_sim.size(-1) - z1_z3_cos.size(-1)) + [0.0] i + [z3_weight] + [0.0] * (z1_z3_cos.size(-1) - i - 1) for i in range(z1_z3_cos.size(-1))]
).to(cls.device)
cos_sim = cos_sim + weights
I think hte weights should multiply cos_sim and [0.0] should replace with [1.1] ?
hi ,I find a problem that your code does not match your paper, z3_weight = cls.model_args.hard_negative_weight weights = torch.tensor( [[0.0] (cos_sim.size(-1) - z1_z3_cos.size(-1)) + [0.0] i + [z3_weight] + [0.0] * (z1_z3_cos.size(-1) - i - 1) for i in range(z1_z3_cos.size(-1))] ).to(cls.device) cos_sim = cos_sim + weights
I think hte weights should multiply cos_sim and [0.0] should replace with [1.1] ?