uber / bayesmark

Benchmark framework to easily compare Bayesian optimization methods on real machine learning tasks
Apache License 2.0
140 stars 34 forks source link

fix: Update lambda functions to methods #8

Closed kaushikb11 closed 4 years ago

kaushikb11 commented 4 years ago

Lambda functions can't be pickled. So if you try to apply multiprocessing to a lambda function, it will fail as Functions are pickled by name, not by code.

Error:

@classmethod
def dumps(cls, obj, protocol=None):
    buf = io.BytesIO()
    cls(buf, protocol).dump(obj)

E AttributeError: Can't pickle local object 'Categorical.init..`

dme65 commented 4 years ago

This should fix the pickle error. Can you run the pre-commit hooks so the tests pass?

The following (run it from the repo root) should do the trick:

pip install pre-commit
pre-commit install
pre-commit run --all-files
kaushikb11 commented 4 years ago

@dme65 : There was a minor Trailing Whitespace Error. Fixed it

rdturnermtl commented 4 years ago

Closing because this is redundant with #6 .