带有warm_Start = True的MLPClassifier收敛一次迭代

时间:2019-03-15 02:31:17

标签: python scikit-learn

我正在使用带有以下参数的scikit Learn的MLPClassifier

mlp = MLPClassifier(hidden_layer_sizes=(3,2,),solver='sgd', verbose=True,
              learning_rate='constant',learning_rate_init=0.001, random_state=rr, 
              warm_start=True, max_iter=400, n_iter_no_change=20)

我想让我的分类器适合不同但非常相似的数据,并查看NN收敛需要多长时间。

我已经生成了一个非常简单的数据集。 It is a data set of 50,000 (x,y) points and the colours denote how I have classified the points.

我的分类器最初是在第一个情节上训练的,然后我做了

mlp.fit(new_data, new_data_labels)

其中,对于每个图,new_data =我的旧数据+新数据集。

这很好,但是,当我使分类器适合新的更大数据集时,它会收敛一次。看来无论如何改变数据,我的分类器覆盖范围都不过是my loss graph looks terrible。我不太确定我要去哪里哪里。

我的输出看起来像这样

Iteration 134, loss = 0.55557070
Iteration 135, loss = 0.55550839
Training loss did not improve more than tol=0.000100 for 20 consecutive epochs. Stopping.
Training set score: 0.663680
Training set loss: 0.555508
Iteration 136, loss = 0.56689723
Training loss did not improve more than tol=0.000100 for 20 consecutive epochs. Stopping.
Training set score: 0.643810
Training set loss: 0.566897
Iteration 137, loss = 0.57723775
Training loss did not improve more than tol=0.000100 for 20 consecutive epochs. Stopping.
Training set score: 0.624447
Training set loss: 0.577238
Iteration 138, loss = 0.58684895
Training loss did not improve more than tol=0.000100 for 20 consecutive epochs. Stopping.

1 个答案:

答案 0 :(得分:0)

您可以使用mlp.loss_curve_来获取模型的损耗曲线。