Aufgrund von Umarbeiten des s3 Storage wird es in GitLab, in nächster Zeit, mögliche Performance-Einbußen geben. Näheres dazu unter: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/43/show_ticket/6670

Commit ea4cada3 authored by Christian Fuß's avatar Christian Fuß

changed metric for show_attend_tell model to bleu

parent 68ae8bc3
......@@ -2,7 +2,7 @@ configuration Show_attend_tell{
num_epoch:2
batch_size:2
context:cpu
eval_metric:accuracy
eval_metric:bleu
loss:softmax_cross_entropy
save_attention_image:true
optimizer:adam{
......
......@@ -115,8 +115,12 @@ class BLEU(mx.metric.EvalMetric):
i *= 2
match_counts = 1 / i
precisions[n] = match_counts / counts
if (match_counts / counts) > 0:
precisions[n] = match_counts / counts
print(precisions)
print(sum(map(math.log, precisions)))
print(math.exp(sum(map(math.log, precisions)) / self.N))
bleu = self._get_brevity_penalty() * math.exp(sum(map(math.log, precisions)) / self.N)
return (self.name, bleu)
......
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