示例#1
0
 def test_grow_strategy(self):
     want = [
         ensemble.Candidate("{}_grow".format(self.fake_builder_1.name),
                            [self.fake_builder_1], []),
         ensemble.Candidate("{}_grow".format(self.fake_builder_2.name),
                            [self.fake_builder_2], [])
     ]
     got = ensemble.GrowStrategy().generate_ensemble_candidates(
         [self.fake_builder_1, self.fake_builder_2], None)
     self.assertEqual(want, got)
示例#2
0
 def test_grow_strategy_with_previous_ensemble_subnetwork_builders(self):
     want = [
         ensemble.Candidate("{}_grow".format(self.fake_builder_1.name),
                            [self.fake_builder_1],
                            [self.fake_builder_3, self.fake_builder_4]),
         ensemble.Candidate("{}_grow".format(self.fake_builder_2.name),
                            [self.fake_builder_2],
                            [self.fake_builder_3, self.fake_builder_4])
     ]
     got = ensemble.GrowStrategy().generate_ensemble_candidates(
         [self.fake_builder_1, self.fake_builder_2],
         [self.fake_builder_3, self.fake_builder_4])
     self.assertEqual(want, got)