예제 #1
0
def analyse():
    # Load results from disk
    errs_pred, errs_base = cPickle.load(open(SAVE_ROOT + 'predictions.pkl', 'rb'))

    # Print results
    print_results('Baseline errors', errs_base)
    print_results('Prediction errors', errs_pred)

    # Plot best predictions, perform layer removal
    MODEL.load(SAVE_PATH)
    indices, _, _ = save_sequences(MODEL, TEST_PREPROCESSOR, SAVE_ROOT + 'qual/')
    test_layer_subsets(MODEL, TEST_PREPROCESSOR, indices, SAVE_ROOT + 'lremoval/')
예제 #2
0
def test():
    # Load model from disk and perform testing
    MODEL.load(SAVE_PATH)
    errs_pred, errs_base = MODEL.test(
        x=TEST_PREPROCESSOR,
        batch_size=BATCH_SIZE,
        metric=('mse', 'psnr', 'dssim'),
    )

    # Save and print baseline/prediction errors
    cPickle.dump((errs_pred, errs_base), open(SAVE_ROOT + 'predictions.pkl', 'wb'), cPickle.HIGHEST_PROTOCOL)
    print_results('Baseline errors', errs_base)
    print_results('Prediction errors', errs_pred)