From 42b7c649353f746d9bc36353f6d4d9d5140a1f7e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 16 Aug 2018 14:28:53 +0300 Subject: [PATCH 1/2] Fixes --- main.py | 4 ++-- neuvol/architecture/individ_base.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 7e0b915..2302421 100644 --- a/main.py +++ b/main.py @@ -30,8 +30,8 @@ def main(): evaluator = neuvol.Evaluator(x_train, y_train, kfold_number=1) mutator = neuvol.Mutator() - evaluator.set_create_tokens = False - evaluator._fitness_measure = 'f1' + evaluator.create_tokens = False + evaluator.fitness_measure = 'f1' options = {'classes': 2, 'shape': (100,), 'depth': 4} wop = neuvol.evolution.Evolution( diff --git a/neuvol/architecture/individ_base.py b/neuvol/architecture/individ_base.py index b8158a7..f737730 100644 --- a/neuvol/architecture/individ_base.py +++ b/neuvol/architecture/individ_base.py @@ -152,8 +152,7 @@ def _check_compatibility(self): output_shape.append(previous_shape[0]) # *out does not work with python < 3.5 - for item in out: - output_shape.append(item) + output_shape.extend(out) output_shape.append(filters) output_shape = tuple(output_shape) @@ -172,8 +171,7 @@ def _check_compatibility(self): output_shape.append(previous_shape[0]) # *previous_shape[1:-1] does not work with python < 3.5 - for item in previous_shape[1:-1]: - output_shape.append(item) + output_shape.extend(previous_shape[1:-1]) output_shape.append(units * bi) output_shape = tuple(output_shape) @@ -186,8 +184,7 @@ def _check_compatibility(self): output_shape.append(previous_shape[0]) # *previous_shape[1:-1] does not work with python < 3.5 - for item in previous_shape[1:-1]: - output_shape.append(item) + output_shape.append(previous_shape[1:-1]) output_shape.append(units) output_shape = tuple(output_shape) From 0035b2a14e47bafef4f3797a7210687b63dd83af Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 16 Aug 2018 14:30:53 +0300 Subject: [PATCH 2/2] Test fix Too heavy --- tests/test_evolution_image.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/test_evolution_image.py b/tests/test_evolution_image.py index 534c603..9b39783 100644 --- a/tests/test_evolution_image.py +++ b/tests/test_evolution_image.py @@ -50,11 +50,6 @@ def test_evolution_mutation(self): self.evolution.mutation_step() self.assertEqual(10, len(self.evolution.population_raw_individ())) - @unittest.expectedFailure - def test_evolution_step(self): - self.evolution.step() - self.assertEqual(10, len(self.evolution.population_raw_individ())) - def test_evolution_crossing(self): self.evolution.crossing_step() self.assertEqual(10, len(self.evolution.population_raw_individ()))