Skip to content

Commit

Permalink
still use same padding for tests so easy to work with small samples
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbuster committed Nov 20, 2024
1 parent 3146313 commit e8345d4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ def pytest_configure(config): # pylint: disable=unused-argument # noqa: ARG001
CONFIG_DIR, 'spatiotemporal', 'gen_3x_4x_2f.json'
)
pytest.S_FP_GEN = os.path.join(CONFIG_DIR, 'spatial', 'gen_2x_2f.json')
pytest.ST_FP_DISC = os.path.join(CONFIG_DIR, 'spatiotemporal', 'disc.json')
pytest.S_FP_DISC = os.path.join(CONFIG_DIR, 'spatial', 'disc.json')

# Note that disc should not use "same" zeros padding but easier to use this
# for testing on small sample sizes.
pytest.ST_FP_DISC = os.path.join(TEST_DATA_DIR, 'config_disc_st_test.json')
pytest.S_FP_DISC = os.path.join(TEST_DATA_DIR, 'config_disc_s_test.json')

pytest.FPS_GCM = [
os.path.join(TEST_DATA_DIR, 'ua_test.nc'),
os.path.join(TEST_DATA_DIR, 'va_test.nc'),
Expand Down
24 changes: 24 additions & 0 deletions tests/data/config_disc_s_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"hidden_layers": [
{"class": "Conv2D", "filters": 32, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 32, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 64, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 64, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 128, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 128, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 256, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv2D", "filters": 256, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Flatten"},
{"class": "Dense", "units": 1024},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Dense", "units": 1}
]
}
26 changes: 26 additions & 0 deletions tests/data/config_disc_st_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"hidden_layers": [
{"class": "Conv3D", "filters": 32, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 32, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 64, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 64, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 128, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 128, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 256, "kernel_size": 3, "padding": "same", "strides": 1},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Conv3D", "filters": 256, "kernel_size": 3, "padding": "same", "strides": 2},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Flatten"},
{"class": "Dense", "units": 2048},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Dense", "units": 1024},
{"alpha": 0.2, "class": "LeakyReLU"},
{"class": "Dense", "units": 1}
]
}

0 comments on commit e8345d4

Please sign in to comment.