Skip to content

Commit

Permalink
Update mixsimulator experiment (benchmark) (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
TokyAxel authored May 12, 2021
1 parent 351e8d6 commit 2fb7d17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nevergrad/benchmark/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ def mixsimulator(seed: tp.Optional[int] = None) -> tp.Iterator[Experiment]:
seedg = create_seed_generator(seed)
optims: tp.List[str] = get_optimizers("basics", seed=next(seedg)) # type: ignore

seq = np.arange(0, 1601, 20)
seq = np.arange(0, 1601, 50)
for budget in seq:
for num_workers in [1, 30]:
if num_workers < budget:
Expand Down
4 changes: 4 additions & 0 deletions nevergrad/benchmark/test_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def test_experiments_registry(name: str, maker: tp.Callable[[], tp.Iterator[expe
if "_pgan" in name and os.environ.get("CIRCLECI", False):
raise SkipTest("Too slow in CircleCI")

# mixsimulator is not accepted by circleci pytest.
if "mixsimulator" in name and os.environ.get("CIRCLECI", False):
raise SkipTest("Sigkill in CircleCI")

# Our IQAs and our ScikitLearn are not well guaranteed on Windows.
if all(x in name for x in ["image", "quality"]) and platform.system() == "Windows":
raise SkipTest("Image quality not guaranteed on Windows.")
Expand Down
9 changes: 7 additions & 2 deletions nevergrad/functions/mixsimulator/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# Based on https://github.com/Foloso/MixSimulator/tree/nevergrad_experiment
# Based on https://github.com/Foloso/MixSimulator

from .. import base

Expand All @@ -24,12 +24,17 @@ class OptimizeMix(base.ExperimentFunction):
"""

def __init__(self, time: int = 168) -> None:
def __init__(self, time: int = 8760) -> None:
try:
from mixsimulator.MixSimulator import MixSimulator # pylint: disable=import-outside-toplevel
from mixsimulator.Demand import Demand

self._mix = MixSimulator()
self._mix.set_data_to("Toamasina")
self._demand = Demand()
self._demand.set_data_to("Toamasina", delimiter=",")
self._mix.set_demand(self._demand)

except (KeyError, AttributeError, ModuleNotFoundError) as e:
# send a skip error so that this does not break the test suit
raise base.UnsupportedExperiment("mixsimulator dependency issue") from e
Expand Down
3 changes: 2 additions & 1 deletion requirements/bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pillow
tqdm
torchvision
pyomo>=5.7
mixsimulator>=0.2.9.9
mixsimulator>=0.3.3
hyperopt>=0.2.5
IOHexperimenter==0.2.8.7
cdt>=0.5
Expand All @@ -24,3 +24,4 @@ tensorflow-estimator==2.3.0
tensorflow>=2.3.1
image-quality==1.2.6
keras==2.2.4

0 comments on commit 2fb7d17

Please sign in to comment.