Esempio n. 1
0
                        action="store_true")

    args = parser.parse_args()

    load_data = LoadData()
    slide_sequences, slide_labels = load_data.get_RNN_data()

    network = Network()

    if args.train:
        network.train_and_save(slide_sequences,
                               slide_labels,
                               "CORRECT",
                               should_save_auc=True)
    else:
        network.load_results("CORRECT")

    if args.conf:
        print('DISPLAYING CONFUSION MATRICES:\n')
        conf = network.get_confusion_matrices()
        for slide_id in range(NUM_SLIDES):
            print('Slide ' + str(slide_id + 1) + ':\n', conf[slide_id])

    if args.acc:
        print('DISPLAYING ACCURACIES:\n')
        acc = network.get_accuracies()
        for slide_id in range(NUM_SLIDES):
            print('Slide ' + str(slide_id + 1) + ':', acc[slide_id], '\n')
        print('Average accuracy of slide 2 to 21:', acc[1:].mean())

    if args.auc:
Esempio n. 2
0
            section=None)
        print('slide_sequences[0][0]: ', slide_sequences[0][0])
        print('discard_last_dup_sequences[0][0]: ',
              discard_last_dup_sequences[0][0])
        print('slide_sequences[9][9]: ', slide_sequences[9][9])
        print('discard_last_dup_sequences[9][9]: ',
              discard_last_dup_sequences[9][9])
        slide_sequences = discard_last_dup_sequences

    if args.train:
        network.train_and_save(slide_sequences,
                               slide_selections,
                               "SELECTION",
                               should_save_auc=False)
    else:
        network.load_results("SELECTION")

    if args.conf:
        print('DISPLAYING CONFUSION MATRICES:\n')
        conf = network.get_confusion_matrices()
        for slide_id in range(NUM_SLIDES):
            print('Slide ' + str(slide_id + 1) + ':\n', conf[slide_id])

    if args.acc:
        print('DISPLAYING ACCURACIES:\n')
        acc = network.get_accuracies()
        for slide_id in range(NUM_SLIDES):
            print('Slide ' + str(slide_id + 1) + ':', acc[slide_id], '\n')
        print('Average accuracy of slide 2 to 21:', acc[1:].mean())

    if args.auc: