2fac66650d131b93041836c1566587a7a4800af6,python/ray/tune/examples/ax_example.py,,,#,47

Before Change



    ray.init()

    config = {
        "num_samples": 10 if args.smoke_test else 50,
        "config": {
            "iterations": 100,
        },
        "stop": {
            "timesteps_total": 100
        }
    }
    parameters = [
        {
            "name": "x1",
            "type": "range",
            "bounds": [0.0, 1.0],
            "value_type": "float",  // Optional, defaults to "bounds".
            "log_scale": False,  // Optional, defaults to False.
        },
        {
            "name": "x2",
            "type": "range",
            "bounds": [0.0, 1.0],
        },
        {
            "name": "x3",
            "type": "range",
            "bounds": [0.0, 1.0],
        },
        {
            "name": "x4",
            "type": "range",
            "bounds": [0.0, 1.0],
        },
        {
            "name": "x5",
            "type": "range",
            "bounds": [0.0, 1.0],
        },
        {
            "name": "x6",
            "type": "range",
            "bounds": [0.0, 1.0],
        },
    ]
    client = AxClient(enforce_sequential_optimization=False)
    client.create_experiment(
        parameters=parameters,
        objective_name="hartmann6",
        minimize=True,  // Optional, defaults to False.
        parameter_constraints=["x1 + x2 <= 2.0"],  // Optional.
        outcome_constraints=["l2norm <= 1.25"],  // Optional.
    )
    algo = AxSearch(ax_client=client, max_concurrent=4)
    scheduler = AsyncHyperBandScheduler(metric="hartmann6", mode="min")
    tune.run(
        easy_objective,
        name="ax",
        search_alg=algo,
        scheduler=scheduler,
        **config)

After Change



    ray.init()

    tune_kwargs = {
        "num_samples": 10 if args.smoke_test else 50,
        "config": {
            "iterations": 100,
            "x1": tune.uniform(0.0, 1.0),
            "x2": tune.uniform(0.0, 1.0),
            "x3": tune.uniform(0.0, 1.0),
            "x4": tune.uniform(0.0, 1.0),
            "x5": tune.uniform(0.0, 1.0),
            "x6": tune.uniform(0.0, 1.0),
        },
        "stop": {
            "timesteps_total": 100
        }
    }
    algo = AxSearch(
        max_concurrent=4,
        metric="hartmann6",
        mode="min",
        parameter_constraints=["x1 + x2 <= 2.0"],  // Optional.
        outcome_constraints=["l2norm <= 1.25"],  // Optional.
    )
    scheduler = AsyncHyperBandScheduler(metric="hartmann6", mode="min")
    tune.run(
        easy_objective,
        name="ax",
        search_alg=algo,
        scheduler=scheduler,
        **tune_kwargs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: ray-project/ray
Commit Name: 2fac66650d131b93041836c1566587a7a4800af6
Time: 2020-09-04
Author: krfricke@users.noreply.github.com
File Name: python/ray/tune/examples/ax_example.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: 2fac66650d131b93041836c1566587a7a4800af6
Time: 2020-09-04
Author: krfricke@users.noreply.github.com
File Name: python/ray/tune/examples/ax_example.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: 088f8ebb69e21c7759af44c6d207a266f4a5d175
Time: 2020-09-07
Author: krfricke@users.noreply.github.com
File Name: python/ray/tune/examples/skopt_example.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: 088f8ebb69e21c7759af44c6d207a266f4a5d175
Time: 2020-09-07
Author: krfricke@users.noreply.github.com
File Name: python/ray/tune/examples/nevergrad_example.py
Class Name:
Method Name: