Commit 5ad5d879 authored by Julian Dierkes's avatar Julian Dierkes
Browse files

Merge branch 'develop' of...

Merge branch 'develop' of git.rwth-aachen.de:monticore/EmbeddedMontiArc/generators/CNNArch2Gluon into develop
parents cd64dbd3 66d4211e
Pipeline #250753 failed with stages
......@@ -144,7 +144,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
......@@ -143,7 +143,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
......@@ -143,7 +143,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
......@@ -143,7 +143,12 @@ class BLEU(mx.metric.EvalMetric):
if self._size_hyp >= self._size_ref:
return 1
else:
return math.exp(1 - (self._size_ref / self._size_hyp))
if self._size_hyp > 0:
size_hyp = self._size_hyp
else:
size_hyp = 1
return math.exp(1 - (self._size_ref / size_hyp))
@staticmethod
def _get_ngrams(sentence, n):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment