From f3b975414c00d7c55c386f2a7f22e6e6031e75ce Mon Sep 17 00:00:00 2001 From: Nolwen Date: Tue, 19 Mar 2024 16:14:25 +0100 Subject: [PATCH] Reduce size of toy network to pass on github runners Remove xfail for add + crown + multid --- tests/conftest.py | 22 +++++++++++----------- tests/test_clone.py | 8 -------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 82e2574b..eae8aa17 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1067,10 +1067,10 @@ def toy_network_tutorial( dtype = keras_config.floatx() layers = [] layers.append(Input(input_shape, dtype=dtype)) - layers.append(Dense(100, dtype=dtype)) + layers.append(Dense(10, dtype=dtype)) if activation is not None: layers.append(Activation(activation, dtype=dtype)) - layers.append(Dense(100, dtype=dtype)) + layers.append(Dense(10, dtype=dtype)) layers.append(Dense(1, activation="linear", dtype=dtype)) model = Sequential(layers) return model @@ -1101,14 +1101,14 @@ def toy_network_submodel( ) -> Model: if dtype is None: dtype = keras_config.floatx() - submodel_input_shape = input_shape[:-1] + (100,) + submodel_input_shape = input_shape[:-1] + (10,) layers = [] layers.append(Input(input_shape, dtype=dtype)) - layers.append(Dense(100, dtype=dtype)) + layers.append(Dense(10, dtype=dtype)) if activation is not None: layers.append(Activation(activation, dtype=dtype)) layers.append(Helpers.toy_network_tutorial(submodel_input_shape, dtype=dtype, activation=activation)) - layers.append(Dense(100, dtype=dtype)) + layers.append(Dense(10, dtype=dtype)) layers.append(Dense(1, activation="linear", dtype=dtype)) model = Sequential(layers) return model @@ -1120,11 +1120,11 @@ def toy_network_add( if dtype is None: dtype = keras_config.floatx() input_tensor = Input(input_shape, dtype=dtype) - output = Dense(100, dtype=dtype)(input_tensor) + output = Dense(10, dtype=dtype)(input_tensor) if activation is not None: output = Activation(activation, dtype=dtype)(output) output = Add()([output, output]) - output = Dense(100, dtype=dtype)(output) + output = Dense(10, dtype=dtype)(output) if activation is not None: output = Activation(activation, dtype=dtype)(output) model = Model(inputs=input_tensor, outputs=output) @@ -1137,11 +1137,11 @@ def toy_network_add_monolayer( if dtype is None: dtype = keras_config.floatx() input_tensor = Input(input_shape, dtype=dtype) - output = Dense(100, dtype=dtype)(input_tensor) + output = Dense(10, dtype=dtype)(input_tensor) if activation is not None: output = Activation(activation, dtype=dtype)(output) output = Add()([output]) - output = Dense(100, dtype=dtype)(output) + output = Dense(10, dtype=dtype)(output) if activation is not None: output = Activation(activation, dtype=dtype)(output) model = Model(inputs=input_tensor, outputs=output) @@ -1153,8 +1153,8 @@ def toy_network_tutorial_with_embedded_activation(input_shape: tuple[int, ...] = dtype = keras_config.floatx() layers = [] layers.append(Input(input_shape, dtype=dtype)) - layers.append(Dense(100, activation="relu", dtype=dtype)) - layers.append(Dense(100, dtype=dtype)) + layers.append(Dense(10, activation="relu", dtype=dtype)) + layers.append(Dense(10, dtype=dtype)) layers.append(Dense(1, activation="linear", dtype=dtype)) model = Sequential(layers) return model diff --git a/tests/test_clone.py b/tests/test_clone.py index 587853e4..55943990 100644 --- a/tests/test_clone.py +++ b/tests/test_clone.py @@ -57,14 +57,6 @@ def test_clone( if toy_model_name == "cnn" and len(input_shape) == 1: pytest.skip("cnn not possible on 0d or 1d input.") - # xfail add model with standard multid input for now (memory issues to be fixed) - if ( - model_decomon_input_metadata["name"] == "standard-multid" - and toy_model_name == "add" - and method.lower().startswith("crown") - ): - pytest.xfail("crown on 'add' toy model crashed sometimes with standard-multid, to be investigated.") - slope = Slope.Z_SLOPE decimal = 4