[tune] Support lambda functions in hyperparameters / tune rllib multiagent support (#2568)

* update

* func

* Update registry.py

* revert
This commit is contained in:
Eric Liang
2018-08-07 16:29:21 -07:00
committed by GitHub
parent e7f76d7914
commit 64053278aa
5 changed files with 40 additions and 23 deletions
@@ -51,6 +51,16 @@ def grid_search(values):
return {"grid_search": values}
class function(object):
"""Wraps `func` to make sure it is not expanded during resolution."""
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
return self.func(*args, **kwargs)
_STANDARD_IMPORTS = {
"random": random,
"np": numpy,