sonsus commited on
Commit
acfc22a
1 Parent(s): f25ae2f

Update harim_plus.py

Browse files
Files changed (1) hide show
  1. 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)/sent_lengths # loglikelihood + lambda * negative_harim (negative harim=-1* risk)
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())