Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在keras中使用fit_生成器实现Scikit GridSerachCV_Python_Keras_Scikit Learn_Hyperparameters - Fatal编程技术网

Python 如何在keras中使用fit_生成器实现Scikit GridSerachCV

Python 如何在keras中使用fit_生成器实现Scikit GridSerachCV,python,keras,scikit-learn,hyperparameters,Python,Keras,Scikit Learn,Hyperparameters,我想在此基础上使用scikit包装器GirdSearchCV执行超参数扫描 我正在尝试使用scikit包装器对其运行GridSearchCV: from sklearn.model_Selection import GridSearchCV from keras.wrappers.sckit_learn import KerasClassifier #After the compile in frontend.py model = KerasClassifier(build_fn = Tiny

我想在此基础上使用scikit包装器GirdSearchCV执行超参数扫描

我正在尝试使用scikit包装器对其运行GridSearchCV:

from sklearn.model_Selection import GridSearchCV
from keras.wrappers.sckit_learn import KerasClassifier

#After the compile in frontend.py
model = KerasClassifier(build_fn = TinyYoloFeature, verbose = 0) #TinyYoloFeature is in backend.py

#After the above command in frontend.py
batch_size = [16,32,64]
learning rate = [0.001, 0.0001, 0.00001]
param_grid = dict (epcohs = nb_epochs,
                   batch_size = batch_size)
grid = GridSearchCV(estimator=model, param_grid = param_grid,n_jobs=-1)
grid_result = grid.fit() #How to go about ????

#print result
print ("Best: %f using %s using %
(grid_result.best_score_,grid_result.best_params_,)
means = grid_result.cv_results_['mean_test_score']
stds = grid_result.cv_results_['std_test_score']
params = grid_result.cv_results_['params']  
for mean, stdev, param in zip (means, stds, params):
print("%f (%f) with: %r" %(mean, stdev, param))  
但是代码使用了fit_生成器。所有在线支持都与model.fit有关。有人能帮忙吗?

可能重复