in ludwig/features/sequence_feature.py [0:0]
def update_metrics(self, targets, predictions):
for metric, metric_fn in self.metric_functions.items():
if metric == LOSS or metric == PERPLEXITY:
metric_fn.update_state(targets, predictions)
elif metric == LAST_ACCURACY:
metric_fn.update_state(targets, predictions[LAST_PREDICTIONS])
else:
metric_fn.update_state(targets, predictions[PREDICTIONS])