我正在尝试使用gridsearchCV来优化超参数kernel\u regularizer,但是gridsearchCV一直告诉我为kernel\u regularizer输入的参数名不是真正的参数
我试过各种各样的参数名,比如l2,kernel\u regularizer,kernel,regularizers.l2,regularizers.l2(),但是没有一个有效。你知道吗
我也在网上查过,但似乎找不到有关这个问题的任何文档
我的序列模型使用核正则化器=l2(0.01)
param_grid = {'kernel_regularizer': [0.01,0.02,0.03]}
grid = GridSearchCV(...)
grid.fit(x_train, y_train) #this is where I get the error:
#ValueError: kernel is not a legal parameter
您必须使用
KerasClassifier
包装您的模型,sklearnGridSearchCV
才能工作。你知道吗Keras Doc,有一个详细的示例。你知道吗
相关问题 更多 >
编程相关推荐