Reputation: 5407
As per the documentation provided by Scikit learn
hidden_layer_sizes : tuple, length = n_layers - 2, default (100,)
I have little doubt.
In my code what I have configured is
MLPClassifier(algorithm='l-bfgs', alpha=1e-5, hidden_layer_sizes=(5, 2), random_state=1)
so what does 5
and 2
indicates?
What I understand is, 5 is the numbers of hidden layers, but then what is 2?
Ref - http://scikit-learn.org/dev/modules/generated/sklearn.neural_network.MLPClassifier.html#
Upvotes: 3
Views: 2653
Reputation: 33147
Some details that I found online concerning the architecture and the units of the input, hidden and output layers in sklearn.
Upvotes: 0
Reputation: 2109
From the link you provided, in parameter table, hidden_layer_sizes
row:
The ith element represents the number of neurons in the ith hidden layer
Which means that you will have len(hidden_layer_sizes)
hidden layers, and, each hidden layer i
will have hidden_layer_sizes[i]
neurons.
In your case, (5, 2)
means:
So the number of hidden layers is implicitely set
Upvotes: 8