Created
August 27, 2020 15:43
-
-
Save yukw777/be1883602326824cd2b6382e0901f55f to your computer and use it in GitHub Desktop.
Hydra Compose API Unit Tests Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.mark.parametrize("network_size", ["small", "big", "huge"]) | |
def test_train_network_size(monkeypatch, tmp_path, capsys, network_size): | |
with initialize(config_path="../leela_zero_pytorch/conf"): | |
cfg = compose( | |
config_name="config", | |
overrides=[ | |
f"+network={network_size}", | |
"data.train_data_dir=tests/test-data", | |
"data.train_dataloader_conf.batch_size=2", | |
"data.val_data_dir=tests/test-data", | |
"data.val_dataloader_conf.batch_size=2", | |
"data.test_data_dir=tests/test-data", | |
"data.test_dataloader_conf.batch_size=2", | |
f"+pl_trainer.default_root_dir={tmp_path}", | |
"+pl_trainer.fast_dev_run=true", | |
"~logger", | |
], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment