<reponame>ducminhkhoi/Video-Attention
import numpy as np
import torch


def my_metric(y_input, y_target):
    assert len(y_input) == len(y_target)
    correct = 0
    for y0, y1 in zip(y_input, y_target):
        if np.array_equal(y0, y1):
            correct += 1
    return correct / len(y_input)


def my_metric2(y_input, y_target):
    assert len(y_input) == len(y_target)
    correct = 0
    for y0, y1 in zip(y_input, y_target):
        if np.array_equal(y0, y1):
            correct += 1
    return correct / len(y_input) * 2


def acc_metric(y_input, y_target):
    assert len(y_input) == len(y_target)
    return np.sum(y_input == y_target)/len(y_input)
