HIPS / Spearmint

Spearmint Bayesian optimization codebase
Other
1.55k stars 329 forks source link

Python3 compatibility #57

Open MechCoder opened 8 years ago

MechCoder commented 8 years ago

Python3 Support

MechCoder commented 8 years ago

I am trying to add Python3 Support, but I'm stuck at this point.

File "/usr/local/lib/python3.4/dist-packages/spearmint-0.1-py3.4.egg/spearmint/grids/sobol.py", line 247, in to_binary return np.ones_like(temp) & temp TypeError: ufunc 'bitwise_and' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

I am unable to proceed further without understanding what this part of the code does.

@JasperSnoek any clue?

MechCoder commented 8 years ago

Ok, I installed it in Python 2. So I'll try to figure it out.

redst4r commented 8 years ago

@MechCoder: the above error is due to an integer division (py2) vs float division (py3) X[:,np.newaxis] // 2**np.arange(bits-1,-1,-1, dtype=np.uint32)

i fixed a couple of other issues for python 3 compatibility, see #70