Commit 454cac54 authored by Marius Kriegerowski's avatar Marius Kriegerowski

sciki-optimize hack

parent c1f59c33
......@@ -18,6 +18,14 @@ def delete_if_exists(dirname):
logger.info('deleting directory: %s' % dirname)
shutil.rmtree(dirname)
def unlist_dict(d):
'''horrible hack to make the strange scikit-optimize list-of-list shit work
'''
for k, v in d.items():
if isinstance(v, list) and len(v) == 1:
d[k] = v[0]
class Model(Object):
hyperparameter_optimizer = Optimizer.T(optional=True)
......@@ -101,6 +109,7 @@ class Model(Object):
def model(self, features, labels, mode, params):
unlist_dict(params)
training = bool(mode == tf.estimator.ModeKeys.TRAIN)
n_filters = 32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment