Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Are hidden layers of sklearn's MLPClassifier() the same as Dense layer of keras/tensorflow?

Theoretically and practically, are the hidden layers of MLPclassifier (refer to hidden_layer_sizes)

mlp = MLPClassifier(hidden_layer_sizes=(4, 3, 2, 1),
                       max_iter = 100, activation = 'relu',
                       solver = 'adam', verbose = type_spec_from_value,
                       random_state = 100, learning_rate = 'invscaling',
                       early_stopping=False
                       )

the same as the Dense layers of tensorflow/keras

mlp = Sequential()
mlp.add(Dense(4))
mlp.add(Dense(3))
mlp.add(Dense(2))
mlp.add(Dense(3))

?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, they are the same. In both cases, the parameters specify the number of neurons.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading