f81184a1a925ec6afaa7388b306398252f7fa45f,tests/multi_objective/samplers_tests/test_nsga2.py,,test_population_size,#,11

Before Change


    study = multi_objective.create_study(["minimize"], sampler=sampler)
    study.optimize(lambda t: [t.suggest_uniform("x", 0, 9)], n_trials=40)

    generations = defaultdict(int)
    for t in study.trials:
        generations[t.system_attrs[multi_objective.samplers._nsga2._GENERATION_KEY]] += 1
    assert dict(generations) == {0: 10, 1: 10, 2: 10, 3: 10}

    // Set `population_size` to 2.
    sampler = multi_objective.samplers.NSGAIIMultiObjectiveSampler(population_size=2)

After Change


    study.optimize(lambda t: [t.suggest_uniform("x", 0, 9)], n_trials=40)

    generations = Counter(
        [t.system_attrs[multi_objective.samplers._nsga2._GENERATION_KEY] for t in study.trials]
    )
    assert generations == {0: 10, 1: 10, 2: 10, 3: 10}

    // Set `population_size` to 2.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: pfnet/optuna
Commit Name: f81184a1a925ec6afaa7388b306398252f7fa45f
Time: 2020-05-15
Author: phjgt308@gmail.com
File Name: tests/multi_objective/samplers_tests/test_nsga2.py
Class Name:
Method Name: test_population_size


Project Name: biocore/scikit-bio
Commit Name: e144e814fa4b542fa70c5b4c167d1253a7a25342
Time: 2014-04-29
Author: josenavasmolina@gmail.com
File Name: skbio/maths/gradient.py
Class Name:
Method Name: make_groups


Project Name: pantsbuild/pants
Commit Name: 705a3dcb90454c2d6ab2a857ac0b88dff2ef0bab
Time: 2020-08-16
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/core/goals/lint.py
Class Name:
Method Name: lint