Esempio n. 1
0
    def test_get_test_scale_with_different_datasets(self):
        Xtr_orig = np.arange(1,11).reshape(10, 1, 1) * 10
        Ytr_orig = -np.arange(10)
        Xts_orig = np.arange(1,11).reshape(10, 1, 1)*2
        Yts_orig = -np.arange(10) - 10
        some_dataset = ImageDataset(Xtr_orig, Ytr_orig, Xts_orig, Yts_orig)

        Xts_1, Yts_1 = some_dataset.get_test(center=True, reduce=True, scale_with=Xtr_orig)
        Xts_2, Yts_2 = some_dataset.get_test(center=True, reduce=True, scale_with=Xtr_orig[:5,:,:])
        assert all(Xts_1 != Xts_2)
Esempio n. 2
0
    def test_get_test_no_args(self):
        Xtr_orig = np.arange(1,11).reshape(10, 1, 1) * 10
        Ytr_orig = -np.arange(10)
        Xts_orig = np.arange(1,11).reshape(10, 1, 1)*2
        Yts_orig = -np.arange(10) - 10
        some_dataset = ImageDataset(Xtr_orig, Ytr_orig, Xts_orig, Yts_orig)

        Xts, Yts = some_dataset.get_test()
        assert all(Xts_orig == Xts)