Skip to content

Commit 9d26360

Browse files
add arxiv link
1 parent f8bc7f4 commit 9d26360

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

onmt/opts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ def model_opts(parser):
194194
group.add('--lambda_coverage', '-lambda_coverage', type=float, default=0.0,
195195
help='Lambda value for coverage loss of See et al (2017)')
196196
group.add('--lambda_cosine', '-lambda_cosine', type=float, default=0.0,
197-
help='Lambda value for cosine alignment loss #TODO cite')
197+
help='Lambda value for cosine alignment loss '
198+
'of https://arxiv.org/abs/1903.07091 ')
198199
group.add('--loss_scale', '-loss_scale', type=float, default=0,
199200
help="For FP16 training, the static loss scale to use. If not "
200201
"set, the loss scale is dynamically computed.")

onmt/utils/statistics.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ def update(self, stat, update_n_src_words=False):
8484
self.loss += stat.loss
8585
self.n_words += stat.n_words
8686
self.n_correct += stat.n_correct
87-
# print("LOSS update", stat.loss)
88-
# print("ZS_LOSS update", stat.zs_loss)
8987
self.cosine_loss += stat.cosine_loss
9088
self.num_ex += stat.num_ex
9189

@@ -105,7 +103,7 @@ def ppl(self):
105103
return math.exp(min(self.loss / self.n_words, 100))
106104

107105
def cos(self):
108-
# print("ZS LOSS", self.zs_loss)
106+
""" normalize cosine distance per example"""
109107
return self.cosine_loss / self.num_ex
110108

111109
def elapsed_time(self):

0 commit comments

Comments
 (0)