def find_pos_neg(pos_matrix, threshold_matrix):
    """Returns the number of true positives, false positives, true negatives, and false negatives."""

    TP = 0
    FP = 0
    TN = 0
    FN = 0

    for x in range(len(pos_matrix)):
        for y in range(len(pos_matrix)):
            true_value = pos_matrix[x][y]
            if true_value == threshold_matrix[x][y]:
                if true_value == 1:
                    TP += 1
                else:
                    TN += 1
            else:
                if true_value == 0:
                    FP += 1
                else:
                    FN += 1

    return TP, FP, TN, FN