コード例 #1
0
def test_amdim(tmpdir):
    reset_seed()

    model = AMDIM(data_dir=tmpdir,
                  batch_size=2,
                  online_ft=True,
                  encoder='resnet18')
    trainer = pl.Trainer(fast_dev_run=True,
                         max_epochs=1,
                         default_root_dir=tmpdir)
    trainer.fit(model)
    loss = trainer.callback_metrics['loss']

    assert loss > 0
コード例 #2
0
def test_amdim(tmpdir):
    reset_seed()

    model = AMDIM(data_dir=tmpdir,
                  batch_size=2,
                  online_ft=True,
                  encoder='resnet18')
    trainer = pl.Trainer(fast_dev_run=True,
                         max_epochs=1,
                         default_root_dir=tmpdir)
    trainer.fit(model)
    loss = trainer.progress_bar_dict['loss']

    assert float(loss) > 0
コード例 #3
0
def test_amdim(tmpdir, datadir):
    model = AMDIM(data_dir=datadir, batch_size=2, online_ft=True, encoder='resnet18', num_workers=0)
    trainer = pl.Trainer(fast_dev_run=True, default_root_dir=tmpdir)
    trainer.fit(model)