How to save the best hyperopt optimized keras models and its weights?
问题 I optimized my keras model using hyperopt. Now how do we save the best optimized keras model and its weights to disk. My code: from hyperopt import fmin, tpe, hp, STATUS_OK, Trials from sklearn.metrics import roc_auc_score import sys X = [] y = [] X_val = [] y_val = [] space = {'choice': hp.choice('num_layers', [ {'layers':'two', }, {'layers':'three', 'units3': hp.uniform('units3', 64,1024), 'dropout3': hp.uniform('dropout3', .25,.75)} ]), 'units1': hp.choice('units1', [64,1024]), 'units2':