diff --git a/test/test_model_modules/test_advanced_paddings.py b/test/test_model_modules/test_advanced_paddings.py index 6035e8d7052710a757c5d9c0b05e08c9a4435355..8ca81c42c0b807b28c444badba8d92a255341eb4 100644 --- a/test/test_model_modules/test_advanced_paddings.py +++ b/test/test_model_modules/test_advanced_paddings.py @@ -472,7 +472,7 @@ class TestPadding2D: else: layer_name = pad_type pd_ap = pd(padding=(1, 2), name=f"{layer_name}_layer")(input_x) - assert pd_ap._keras_history[0]._input_shape == (None, 32, 32, 3) - assert pd_ap._keras_history[0]._output_shape == (None, 34, 36, 3) + assert pd_ap._keras_history[0].input_shape == (None, 32, 32, 3) + assert pd_ap._keras_history[0].output_shape == (None, 34, 36, 3) assert pd_ap._keras_history[0].padding == ((1, 1), (2, 2)) assert pd_ap._keras_history[0].name == f"{layer_name}_layer" diff --git a/test/test_model_modules/test_flatten_tail.py b/test/test_model_modules/test_flatten_tail.py index 1ef0bdd97ebfc0d609a94facd036ed68f824731d..623d51c07f6b27c8d6238d8a5189dea33837115e 100644 --- a/test/test_model_modules/test_flatten_tail.py +++ b/test/test_model_modules/test_flatten_tail.py @@ -67,7 +67,7 @@ class TestFlattenTail: flatten = self.step_in(inner_dense) assert flatten.name == 'Main_tail' input_layer = self.step_in(flatten) - assert input_layer._input_shape == (None, 7, 1, 2) + assert input_layer.input_shape == (None, 7, 1, 2) def test_flatten_tail_all_settings(self, model_input): tail = flatten_tail(input_x=model_input, inner_neurons=64, activation=keras.layers.advanced_activations.ELU, @@ -115,5 +115,5 @@ class TestFlattenTail: assert isinstance(reduc_conv.kernel_regularizer, keras.regularizers.L1L2) input_layer = self.step_in(reduc_conv) - assert input_layer._input_shape == (None, 7, 1, 2) + assert input_layer.input_shape == (None, 7, 1, 2) diff --git a/test/test_model_modules/test_model_class.py b/test/test_model_modules/test_model_class.py index 0ad5d123c25c085e5d31ff75133bc8fef7e09f57..28218eb60e23d6e5b0e361fc2617398aade799cc 100644 --- a/test/test_model_modules/test_model_class.py +++ b/test/test_model_modules/test_model_class.py @@ -181,10 +181,10 @@ class TestAbstractModelClass: assert amc.compile == amc.model.compile def test_get_settings(self, amc, amsc): - assert amc.get_settings() == {"model_name": "AbstractModelClass", "shape_inputs": (14, 1, 2), - "shape_outputs": 3} + assert amc.get_settings() == {"model_name": "AbstractModelClass", "_input_shape": (14, 1, 2), + "_output_shape": 3} assert amsc.get_settings() == {"test_attr": "testAttr", "model_name": "AbstractModelSubClass", - "shape_inputs": (12, 1, 2), "shape_outputs": 3} + "_input_shape": (12, 1, 2), "_output_shape": 3} def test_custom_objects(self, amc): amc.custom_objects = {"Test": 123} @@ -217,7 +217,7 @@ class TestMyPaperModel: def test_set_model(self, mpm): assert isinstance(mpm.model, keras.Model) - assert mpm.model.layers[0]._output_shape == (None, 7, 1, 9) + assert mpm.model.layers[0].output_shape == (None, 7, 1, 9) # check output dimensions if isinstance(mpm.model.output_shape, tuple): assert mpm.model.output_shape == (None, 4) diff --git a/test/test_run_modules/test_model_setup.py b/test/test_run_modules/test_model_setup.py index d2989a937383aad71670f72f39ecfa8b8fed29dd..382105344dfb9fffb37215f2706dda1f2ebd90ea 100644 --- a/test/test_run_modules/test_model_setup.py +++ b/test/test_run_modules/test_model_setup.py @@ -49,10 +49,10 @@ class TestModelSetup: @pytest.fixture def setup_with_gen(self, setup, keras_iterator): setup.data_store.set("data_collection", keras_iterator, "train") - shape_inputs = [keras_iterator[0].get_X()[0].shape[1:]] - setup.data_store.set("shape_inputs", shape_inputs, "model") - shape_outputs = [keras_iterator[0].get_Y()[0].shape[1:]] - setup.data_store.set("shape_outputs", shape_outputs, "model") + input_shape = [keras_iterator[0].get_X()[0].shape[1:]] + setup.data_store.set("input_shape", input_shape, "model") + output_shape = [keras_iterator[0].get_Y()[0].shape[1:]] + setup.data_store.set("output_shape", output_shape, "model") yield setup RunEnvironment().__del__() @@ -103,16 +103,16 @@ class TestModelSetup: setup_with_gen.build_model() assert isinstance(setup_with_gen.model, AbstractModelClass) expected = {"lr_decay", "model_name", "dropout_rate", "regularizer", "initial_lr", "optimizer", "activation", - "shape_inputs", "shape_outputs"} + "input_shape", "output_shape"} assert expected <= self.current_scope_as_set(setup_with_gen) def test_set_shapes(self, setup_with_gen_tiny): - assert len(setup_with_gen_tiny.data_store.search_name("shape_inputs")) == 0 - assert len(setup_with_gen_tiny.data_store.search_name("shape_outputs")) == 0 + assert len(setup_with_gen_tiny.data_store.search_name("input_shape")) == 0 + assert len(setup_with_gen_tiny.data_store.search_name("output_shape")) == 0 setup_with_gen_tiny._set_shapes() - assert setup_with_gen_tiny.data_store.get("shape_inputs", setup_with_gen_tiny.scope) == [(14, 1, 5), (10, 1, 2), + assert setup_with_gen_tiny.data_store.get("input_shape", setup_with_gen_tiny.scope) == [(14, 1, 5), (10, 1, 2), (1, 1, 2)] - assert setup_with_gen_tiny.data_store.get("shape_outputs", setup_with_gen_tiny.scope) == [(5,), (3,)] + assert setup_with_gen_tiny.data_store.get("output_shape", setup_with_gen_tiny.scope) == [(5,), (3,)] def test_load_weights(self): pass