本文介绍了Python scikit学习MLPClassifier“hidden_​​layer_sizes"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我迷失在 scikit learn 0.18 用户手册 (http://scikit-learn.org/dev/modules/generated/sklearn.neural_network.MLPClassifier.html#sklearn.neural_network.MLPClassifier):

I am lost in the scikit learn 0.18 user manual (http://scikit-learn.org/dev/modules/generated/sklearn.neural_network.MLPClassifier.html#sklearn.neural_network.MLPClassifier):

   hidden_layer_sizes : tuple, length = n_layers - 2, default (100,)
   The ith element represents the number of neurons in the ith hidden layer.

如果我在我的模型中只寻找 1 个隐藏层和 7 个隐藏单元,我应该这样放置吗?谢谢!

If I am looking for only 1 hidden layer and 7 hidden units in my model, should I put like this? Thanks!

    hidden_layer_sizes=(7, 1)

推荐答案

hidden_​​layer_sizes=(7,) 如果你只想要 1 个隐藏层和 7 个隐藏单元.

hidden_layer_sizes=(7,) if you want only 1 hidden layer with 7 hidden units.

length = n_layers - 2 是因为你有 1 个输入层和 1 个输出层.

length = n_layers - 2 is because you have 1 input layer and 1 output layer.

这篇关于Python scikit学习MLPClassifier“hidden_​​layer_sizes"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 07:38