this is the whole calculation:
def success(prediction, label):
    l = len(prediction)
    for i in range(l):
        if(prediction[i] > 0.5 and label[i] == 1):
            return True
    return False


def accuracy_score(y_true, y_pred):
    acc = 0
    batch_size = len(y_true)
    for i in range(batch_size):
        if(success(y_pred[i],y_true[i])):
            acc = acc + 1
    return float(acc)/batch_size