Skip to content

Commit

Permalink
Clarify installation variants and prepare relevant places for GP-Band…
Browse files Browse the repository at this point in the history
…it; also change version to 0.1.0

PiperOrigin-RevId: 505714229
  • Loading branch information
xingyousong authored and copybara-github committed Jan 30, 2023
1 parent 25e1c38 commit 9a6c462
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,35 @@ Please see OSS Vizier's [ReadTheDocs documentation](https://oss-vizier.readthedo


## Installation <a name="installation"></a>
To install the **core API**, the simplest way is to run:
**Most common:** To tune objectives using our default state-of-the-art JAX-based Bayesian Optimizer, run:

```
pip install google-vizier
pip install google-vizier[jax]
```

which will install the necessary dependencies from `requirements.txt`.
To install a **minimal version** that consists of only the core service and client API from `requirements.txt`, run:

```
pip install google-vizier
```

For **full installation** (to support **all algorithms and benchmarks**), run:
For **full installation** to support all algorithms and benchmarks, run:

```
pip install google-vizier[extra]
```

which will also install the dependencies:
For **specific installations**, you can run:

```
pip install google-vizier[X]
```

which will install additional packages from `requirements-X.txt`, such as:

* `requirements-jax.txt`: Jax libraries shared by both algorithms and benchmarks.
* `requirements-tf.txt`: Tensorflow libraries used by benchmarks.
* `requirements-algorithms.txt`: Additional repositories (e.g. Emukit) for algorithms.
* `requirements-algorithms.txt`: Additional repositories (e.g. EvoJAX) for algorithms.
* `requirements-benchmarks.txt`: Additional repositories (e.g. NASBENCH-201) for benchmarks.
* `requirements-test.txt`: Libraries needed for testing code.

Expand Down
2 changes: 1 addition & 1 deletion demos/run_vizier_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def main(argv: Sequence[str]) -> None:
if FLAGS.multiobjective:
study_config.algorithm = vz.Algorithm.NSGA2
else:
study_config.algorithm = vz.Algorithm.EMUKIT_GP_EI
study_config.algorithm = vz.Algorithm.GAUSSIAN_PROCESS_BANDIT

study = clients.Study.from_study_config(
study_config, owner='my_name', study_id='cifar10'
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/user/running_vizier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"outputs": [],
"source": [
"!pip install google-vizier"
"!pip install google-vizier[jax]"
]
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@
"outputs": [],
"source": [
"study_config = vz.StudyConfig.from_problem(problem)\n",
"study_config.algorithm = vz.Algorithm.RANDOM_SEARCH"
"study_config.algorithm = vz.Algorithm.GAUSSIAN_PROCESS_BANDIT"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion vizier/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@

sys.path.append(PROTO_ROOT)

__version__ = "0.0.20"
__version__ = "0.1.0"
4 changes: 2 additions & 2 deletions vizier/_src/pyvizier/oss/study_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

class Algorithm(enum.Enum):
"""Valid Values for StudyConfig.Algorithm."""
# Let Vizier choose the algorithm. Currently defaults to RANDOM_SEARCH.
# Let Vizier choose algorithm. Currently defaults to GAUSSIAN_PROCESS_BANDIT.
ALGORITHM_UNSPECIFIED = 'ALGORITHM_UNSPECIFIED'
# Gaussian Process Bandit.
GAUSSIAN_PROCESS_BANDIT = 'GAUSSIAN_PROCESS_BANDIT'
Expand Down Expand Up @@ -133,7 +133,7 @@ class StudyConfig(vz.ProblemStatement):
validator=attr.validators.instance_of((Algorithm, str)),
converter=lambda x: x.value if isinstance(x, enum.Enum) else x,
on_setattr=[attr.setters.convert, attr.setters.validate],
default='RANDOM_SEARCH',
default='ALGORITHM_UNSPECIFIED',
kw_only=True)

pythia_endpoint: Optional[str] = attr.field(
Expand Down
6 changes: 5 additions & 1 deletion vizier/service/policy_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ def __call__(
study_name: str,
) -> pythia.Policy:
del study_name
if algorithm in ('DEFAULT', 'ALGORITHM_UNSPECIFIED'):
if algorithm in (
'DEFAULT',
'ALGORITHM_UNSPECIFIED',
'GAUSSIAN_PROCESS_BANDIT',
):
from vizier._src.algorithms.designers import gp_bandit

return dp.DesignerPolicy(policy_supporter, gp_bandit.VizierGPBandit)
Expand Down

0 comments on commit 9a6c462

Please sign in to comment.