Spaces:
Running
Running
Update harim_plus.py
Browse files- harim_plus.py +1 -1
harim_plus.py
CHANGED
@@ -238,7 +238,7 @@ class Harimplus_Scorer:
|
|
238 |
harim_tok = self.harim(s2s_logits, lm_logits, tgt_in.input_ids, tgt_mask)
|
239 |
harim = harim_tok.sum(-1) / sent_lengths
|
240 |
|
241 |
-
harim_plus_normalized = (ll + self._lambda * harim)
|
242 |
|
243 |
scores['harim+'].extend(harim_plus_normalized.tolist())
|
244 |
scores['harim'].extend(harim.tolist())
|
|
|
238 |
harim_tok = self.harim(s2s_logits, lm_logits, tgt_in.input_ids, tgt_mask)
|
239 |
harim = harim_tok.sum(-1) / sent_lengths
|
240 |
|
241 |
+
harim_plus_normalized = (ll + self._lambda * harim) # loglikelihood + lambda * negative_harim (negative harim=-1* risk)
|
242 |
|
243 |
scores['harim+'].extend(harim_plus_normalized.tolist())
|
244 |
scores['harim'].extend(harim.tolist())
|