This commit is contained in:
PatrickBue 2019-06-25 22:24:18 -04:00
Родитель abb226f16e
Коммит 1ca9d51e15
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -79,7 +79,7 @@ def tiny_ic_data(tiny_ic_data_path):
ImageList.from_folder(tiny_ic_data_path)
.split_by_rand_pct(valid_pct=0.2, seed=10)
.label_from_folder()
.transform(size=299)
.transform(size=50)
.databunch(bs=16)
.normalize(imagenet_stats)
)
@ -118,12 +118,12 @@ def test_train_metrics_recorder(tiny_ic_data):
assert len(cb.train_metrics[0]) == 1 # we used 1 metrics
assert len(cb.valid_metrics) == 0 # no validation
def test_get_preds(tiny_ic_data):
model = models.resnet18
lr = 1e-4
epochs = 1
learn = cnn_learner(tiny_ic_data, model)
learn.fit(epochs, lr)
pred_outs = get_preds(learn, tiny_ic_data.valid_dl)

Просмотреть файл

@ -60,12 +60,12 @@ def test_update_parameters_01(tiny_ic_data_path):
# at this point there should only be 1 permutation of the default params
assert len(sweeper.permutations) == 1
sweeper.update_parameters(
learning_rate=[1e-3, 1e-4, 1e-5], im_size=[50, 55], epochs=[1]
learning_rate=[1e-4], im_size=[50, 55], epochs=[1]
)
# assert that there are not 6 permutations
assert len(sweeper.permutations) == 6
assert len(sweeper.permutations) == 2
df = sweeper.run([tiny_ic_data_path], reps=1)
_test_sweeper_run(df, df_length=6)
_test_sweeper_run(df, df_length=2)
def test_update_parameters_02():