diff --git a/examples/Gordo-Workflow-High-Level.ipynb b/examples/Gordo-Workflow-High-Level.ipynb index b72b883a7..b7aff8590 100644 --- a/examples/Gordo-Workflow-High-Level.ipynb +++ b/examples/Gordo-Workflow-High-Level.ipynb @@ -71,7 +71,7 @@ " steps:\n", " - sklearn.preprocessing.data.MinMaxScaler\n", " - gordo_components.model.models.KerasAutoEncoder:\n", - " kind: feedforward_model\n", + " kind: feedforward_hourglass\n", "\"\"\"" ] }, diff --git a/examples/Gordo-Workflow-Semi-Low-Level.ipynb b/examples/Gordo-Workflow-Semi-Low-Level.ipynb index 034ca58a6..f89ffcef9 100644 --- a/examples/Gordo-Workflow-Semi-Low-Level.ipynb +++ b/examples/Gordo-Workflow-Semi-Low-Level.ipynb @@ -180,7 +180,7 @@ " steps:\n", " - sklearn.preprocessing.data.MinMaxScaler\n", " - gordo_components.model.models.KerasAutoEncoder:\n", - " kind: feedforward_model\n", + " kind: feedforward_hourglass\n", " \"\"\"\n", ")\n", "pipe = serializer.pipeline_from_definition(config)\n", diff --git a/gordo_components/builder/build_model.py b/gordo_components/builder/build_model.py index d73c49969..bec12005a 100644 --- a/gordo_components/builder/build_model.py +++ b/gordo_components/builder/build_model.py @@ -25,7 +25,7 @@ def build_model(model_config: dict, data_config: dict, metadata: dict): model_config: dict - mapping of Model to initialize and any additional kwargs which are to be used in it's initialization Example: {'type': 'KerasAutoEncoder', - 'kind': 'feedforward_model'} + 'kind': 'feedforward_hourglass'} data_config: dict - mapping of the Dataset to initialize, following the same logic as model_config metadata: dict - mapping of arbitrary metadata data diff --git a/gordo_components/cli.py b/gordo_components/cli.py index 62d2affd4..b14befd33 100644 --- a/gordo_components/cli.py +++ b/gordo_components/cli.py @@ -36,7 +36,8 @@ def gordo(): DEFAULT_MODEL_CONFIG = ( - "{'gordo_components.model.models.KerasAutoEncoder': {'kind': 'feedforward_model'}}" + "{'gordo_components.model.models.KerasAutoEncoder': {'kind': " + "'feedforward_hourglass'}} " ) diff --git a/gordo_components/serializer/serializer.py b/gordo_components/serializer/serializer.py index f383bd213..7b89b94c3 100644 --- a/gordo_components/serializer/serializer.py +++ b/gordo_components/serializer/serializer.py @@ -241,7 +241,7 @@ def dump(obj: object, dest_dir: str, metadata: dict = None): ... # PCA is picklable ... ('pca', PCA(3)), ... # KerasAutoEncoder implements both `save_to_dir` and `load_from_dir` - ... ('model', KerasAutoEncoder(kind='feedforward_model'))]) + ... ('model', KerasAutoEncoder(kind='feedforward_hourglass'))]) >>> with TemporaryDirectory() as tmp: ... serializer.dump(obj=pipe, dest_dir=tmp) ... pipe_clone = serializer.load(source_dir=tmp) diff --git a/tests/test_builder.py b/tests/test_builder.py index d2aa504af..3ffeb32ce 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -21,7 +21,7 @@ def test_output_dir(self): model_config = { "gordo_components.model.models.KerasAutoEncoder": { - "kind": "feedforward_model" + "kind": "feedforward_hourglass" } } data_config = {"type": "RandomDataset"} diff --git a/tests/test_cli.py b/tests/test_cli.py index a5773ba50..9f1b5eaa4 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -32,7 +32,7 @@ def test_build_env_args(self): model_config = { "gordo_components.model.models.KerasAutoEncoder": { - "kind": "feedforward_model" + "kind": "feedforward_hourglass" } } diff --git a/tests/test_gordo_server.py b/tests/test_gordo_server.py index 3fb889d4b..9092a0e4f 100644 --- a/tests/test_gordo_server.py +++ b/tests/test_gordo_server.py @@ -32,7 +32,7 @@ def _build_model(target_dir): steps: - sklearn.preprocessing.data.MinMaxScaler - gordo_components.model.models.KerasAutoEncoder: - kind: feedforward_model + kind: feedforward_hourglass memory: """, Loader=ruamel.yaml.Loader, diff --git a/tests/test_serializer_from_definition.py b/tests/test_serializer_from_definition.py index 02cb9a5dd..a00f8eec4 100644 --- a/tests/test_serializer_from_definition.py +++ b/tests/test_serializer_from_definition.py @@ -64,7 +64,7 @@ def setUp(self): n_jobs: 1 transformer_weights: - gordo_components.model.models.KerasAutoEncoder: - kind: feedforward_model + kind: feedforward_hourglass """, # This has only some named parameters included """ @@ -85,7 +85,7 @@ def setUp(self): - sklearn.decomposition.truncated_svd.TruncatedSVD: n_components: 2 - gordo_components.model.models.KerasAutoEncoder: - kind: feedforward_model + kind: feedforward_hourglass """, # Define pipeline memory with something other than None w/o metadata """ @@ -130,7 +130,7 @@ def setUp(self): n_jobs: 1 transformer_weights: - gordo_components.model.models.KerasAutoEncoder: - kind: feedforward_model + kind: feedforward_hourglass """, ] @@ -193,4 +193,4 @@ def _verify_pipe(self, pipe): # STEP 4 TEST: Finally, the last step should be a KerasModel step4 = pipe.steps[3][1] self.assertIsInstance(step4, KerasAutoEncoder) - self.assertTrue(step4.kind, "feedforward_model") + self.assertTrue(step4.kind, "feedforward_hourglass") diff --git a/tests/test_serializer_into_definition.py b/tests/test_serializer_into_definition.py index 835b1375b..8b7387829 100644 --- a/tests/test_serializer_into_definition.py +++ b/tests/test_serializer_into_definition.py @@ -43,7 +43,7 @@ def setUp(self): ] ), ), - ("ae", KerasAutoEncoder(kind="feedforward_model")), + ("ae", KerasAutoEncoder(kind="feedforward_hourglass")), ] ), # MinMax initialized (wrongly) with a list @@ -67,7 +67,7 @@ def setUp(self): ] ), ), - ("ae", KerasAutoEncoder(kind="feedforward_model")), + ("ae", KerasAutoEncoder(kind="feedforward_hourglass")), ] ), # MinMax initialized with tuple @@ -91,7 +91,7 @@ def setUp(self): ] ), ), - ("ae", KerasAutoEncoder(kind="feedforward_model")), + ("ae", KerasAutoEncoder(kind="feedforward_hourglass")), ] ), # First pipeline without explicit steps param, other with. @@ -115,7 +115,7 @@ def setUp(self): ] ), ), - ("ae", KerasAutoEncoder(kind="feedforward_model")), + ("ae", KerasAutoEncoder(kind="feedforward_hourglass")), ] ), ] @@ -161,7 +161,7 @@ def test_pipeline_into_definition(self): n_jobs: transformer_weights: - gordo_components.model.models.KerasAutoEncoder: - kind: feedforward_model + kind: feedforward_hourglass memory: """.rstrip() .strip() @@ -214,7 +214,7 @@ def test_into_from(self): "step_2", FunctionTransformer(func=multiply_by, kw_args={"factor": 1}), ), - ("step_3", KerasAutoEncoder(kind="feedforward_model")), + ("step_3", KerasAutoEncoder(kind="feedforward_hourglass")), ] ) @@ -269,7 +269,7 @@ def test_from_into(self): n_jobs: 1 transformer_weights: - gordo_components.model.models.KerasAutoEncoder: - kind: feedforward_model + kind: feedforward_hourglass memory: """ definition = ruamel.yaml.load(definition, Loader=ruamel.yaml.Loader) diff --git a/tests/test_serializer_load_dump.py b/tests/test_serializer_load_dump.py index 216ea6e13..48f69db01 100644 --- a/tests/test_serializer_load_dump.py +++ b/tests/test_serializer_load_dump.py @@ -68,7 +68,7 @@ def test_pipeline_serialization(self): ] ), ), - ("ae", KerasAutoEncoder(kind="feedforward_model")), + ("ae", KerasAutoEncoder(kind="feedforward_hourglass")), ] ) @@ -162,7 +162,7 @@ def test_pipeline_serialization(self): def test_dump_load_keras_directly(self): - model = KerasAutoEncoder(kind="feedforward_model") + model = KerasAutoEncoder(kind="feedforward_hourglass") X = np.random.random(size=100).reshape(10, 10) model.fit(X.copy(), X.copy())