From c6aa68e7bcd3bf7e11998c5fd61b4c53037b0325 Mon Sep 17 00:00:00 2001 From: herilalaina Date: Tue, 11 Jul 2023 21:34:15 +0200 Subject: [PATCH 1/2] fix dependencies --- README.md | 4 +++- optformer/t5x/policies.py | 3 +-- requirements.txt | 8 ++++++-- setup.py | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 187df0e..db8fb96 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ This is the code used for the paper [Towards Learning Universal Hyperparameter Optimizers with Transformers (NeurIPS 2022)](https://arxiv.org/abs/2205.13320). # Installation -All base dependencies can be installed from `requirements.txt`. Afterwards, [T5X](https://github.com/google-research/t5x) must be manually installed. +To get started, manually install [T5X](https://github.com/google-research/t5x). Afterwards, install OptFormer with ``pip install -e .``. + + # Usage diff --git a/optformer/t5x/policies.py b/optformer/t5x/policies.py index 6538876..b13e76a 100644 --- a/optformer/t5x/policies.py +++ b/optformer/t5x/policies.py @@ -387,9 +387,8 @@ def _thompson_sampling( return max_funs def update( - self, completed: vza.CompletedTrials, all_active: vza.ActiveTrials + self, completed: vza.CompletedTrials ) -> None: - del all_active completed_trials = [] for trial in completed.trials: # A completed trial either has a final_measurement or is marked as diff --git a/requirements.txt b/requirements.txt index ca7c8c8..4effe59 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,16 @@ # T5X prerequisite. -seqio # Always compatible with most up-to-date version. +t5 +seqio==0.0.13 # Always compatible with most up-to-date version. # OSS Vizier -google-vizier # Use latest version. +google-vizier==0.0.20 # Use latest version. # Proto protobuf>=3.6,<4.0 +# For the notebook +matplotlib + # Autodiff and numerical packages. numpy>=1.21.5 tensorflow>=2.9.1 diff --git a/setup.py b/setup.py index 38d3bdc..c3d6b59 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def _strip_comments_from_line(s: str) -> str: return requirement.strip() -def _parse_requirements(requirements_txt_path: str) -> list[str]: +def _parse_requirements(requirements_txt_path: str): """Returns a list of dependencies for setup() from requirements.txt.""" with open(requirements_txt_path) as fp: From 95a8ae211bfec31d21aea664f4513c4146222977 Mon Sep 17 00:00:00 2001 From: herilalaina Date: Tue, 11 Jul 2023 21:39:39 +0200 Subject: [PATCH 2/2] fix typing --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c3d6b59..38d3bdc 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def _strip_comments_from_line(s: str) -> str: return requirement.strip() -def _parse_requirements(requirements_txt_path: str): +def _parse_requirements(requirements_txt_path: str) -> list[str]: """Returns a list of dependencies for setup() from requirements.txt.""" with open(requirements_txt_path) as fp: