I am trying to implement Python's MLPClassifier with 10 fold cross-validation using gridsearchCV function. Here is a chunk of my code:
parameters={
'learning_rate': ["constant", "invscaling", "adaptive"],
'hidden_layer_sizes': [(100,1), (100,2), (100,3)],
'alpha': [10.0 ** -np.arange(1, 7)],
'activation': ["logistic", "relu", "Tanh"]
}
clf
= gridSearchCV(estimator=MLPClassifier,param_grid=parameters,n_jobs=-1,verbose=2,cv=10)
Though,I am not sure if hidden_layer_sizes: [(100,1), (100,2), (100,3)]
is correct. Here, I am trying to tune 'hidden layer size' & 'number of neurons'. I would like to give this 'tuple' parameter for hidden_layer_sizez: 1, 2, 3, and neurons: 10, 20, 30,...,100.
But I do not know if it is the correct way to do it. Therefore, I am choosing default neurons to be 100 in each layer.
Can anyone advise please?
'hidden_layer_sizes': [x for x in product(range(1,100), range(1,3))]
$\endgroup$