def check_true(answer, label):
    """
    Check if a given answer matches the label
    :param answer: the probability output from the network
    :type answer: float
    :param label: the label integer as either a 1 or a 0
    :type label: float
    :return: 1 if classification is correct, 0 if incorrect
    :rtype: int
    """
    if answer > 0.5 and label == 1:
        return 1
    elif answer < 0.5 and label == 0:
        return 1
    else:
        return 0