示例#1
0
def main_predict() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_04_08_2')

    model = CNNAugDataRegularized((32, 64, 128, 256), (512, 128), 4, device)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 18, 20, tracker, learning_rate=0.0001)

    test_X, imgs_ids = data.get_test()
    pred_y = model.predict(test_X)
    create_submit(pred_y, imgs_ids, path.join(save_dir, 'submission.csv'))
def main_predict() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_04_25_1')

    model = DropoutCNN((32, 64, 128, 256), (512, 128),
                       4,
                       device,
                       drop_dense_p=0.2,
                       drop_conv_p=0.2)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 30, 20, tracker, learning_rate=0.0001)

    test_X, imgs_ids = data.get_test()
    pred_y = model.predict(test_X)
    create_submit(pred_y, imgs_ids, path.join(save_dir, 'submission.csv'))
示例#3
0
def main() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_05_10_1')

    model = VGGStyleNet(4, device)
    summary(model.cuda(), (3, 128, 128))
    print(model)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 40, 64, tracker, learning_rate=0.00001)

    tracker.graphs()
    tracker.save('metrics.csv')

    test_X, imgs_ids = data.get_test()
    pred_y = model.predict(test_X)
    create_submit(pred_y, imgs_ids, path.join(save_dir, 'submission.csv'))
示例#4
0
def main_train() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_04_08_1')

    model = CNNAugDataRegularized((32, 64, 128, 256), (1024, 128), 4, device)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 60, 20, tracker, learning_rate=0.0001)

    tracker.graphs()
    tracker.save('metrics.csv')
def main_train() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_04_26_2')

    model = TransferCNN(device)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 20, 20, tracker, learning_rate = 0.0001)
    
    tracker.graphs()
    tracker.save('metrics.csv')
示例#6
0
def main() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_05_10_2')
    batch_size = 64
    epochs = 15

    model = VGGStyleBNNet(4, device)
    summary(model.cuda(), (3, 128, 128))
    print(model)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    try:
        model.train(data, epochs, batch_size, tracker, learning_rate=0.001)
    except KeyboardInterrupt:
        print('Training interrupted, writing stats...')
    finally:
        tracker.graphs()
        tracker.save('metrics.csv')

    test_X, imgs_ids = data.get_test()
    pred_y = model.predict(test_X, batch_size)
    create_submit(pred_y, imgs_ids, path.join(save_dir, 'submission.csv'))
示例#7
0
def main_train() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_04_26_1')

    conv_filter_nums = (16, 32, 64, 64, 128, 128)
    neuron_nums = (512, 128)

    model = BigCNN(conv_filter_nums, neuron_nums, device)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 40, 20, tracker, learning_rate=0.0001)

    tracker.graphs()
    tracker.save('metrics.csv')
def main_train() -> None:
    detect_gpu()
    device = get_device()
    save_dir = path.join('modelling', 'model_2020_04_25_1')

    model = DropoutCNN((32, 64, 128, 256), (512, 128),
                       4,
                       device,
                       drop_dense_p=0.2,
                       drop_conv_p=0.2)
    data = FirstAugmentedDataset()
    tracker = PerformanceTracker(save_dir)
    model.train(data, 40, 20, tracker, learning_rate=0.0001)

    tracker.graphs()
    tracker.save('metrics.csv')