关于matlab中的kernel:svmtrain-约束不够严格。

svmtrain in matlab - the constraints are not restrictive enough.

我在具有MLP内核的matlab中使用svmtrain,如下所示:

1
mlp=svmtrain(train_data,train_label,'Kernel_Function','mlp','showplot',true);

但我收到此错误:

1
2
3
4
??? Error using ==> svmtrain at 470
Unable to solve the optimization problem:
Exiting: the solution is unbounded and at infinity;
the constraints are not restrictive enough.

原因是什么?我尝试了其他内核,没有任何错误。
即使我尝试了svmtrain的答案-也无法解决优化问题,如下所示:

1
2
3
options = optimset('maxiter',1000);
svmtrain(train_data,train_label,'Kernel_Function','mlp','Method','QP',...
'quadprog_opts',options);

但是我又遇到了同样的错误。
我的训练集是2类数据点的简单45 * 2数据集。


此处的解决方案并没有真正解释任何内容。问题是二次规划方法无法在优化问题上收敛。正常的做法是增加迭代次数,但是我已经在具有1,000,000次迭代的相同大小的数据上对此进行了测试,但仍然无法收敛。

1
2
3
4
5
6
7
8
9
options = optimset('maxIter',1000000);

mlp = svmtrain(data,labels,'Kernel_Function','mlp','Method','QP',...
'quadprog_opts',options);

??? Error using ==> svmtrain at 576
Unable to solve the optimization problem:
Exiting: the solution is unbounded and at infinity;
 the constraints are not restrictive enough.

我的问题是:您是否出于某种原因在SMO上使用了二次编程?使用SMO做完全相同的事情可以正常工作:

1
2
3
4
5
6
7
8
9
10
11
12
13
mlp = svmtrain(data,labels,'Kernel_Function','mlp','Method','SMO');

mlp =

          SupportVectors: [40x2 double]
                   Alpha: [40x1 double]
                    Bias: 0.0404
          KernelFunction: @mlp_kernel
      KernelFunctionArgs: {}
              GroupNames: [45x1 double]
    SupportVectorIndices: [40x1 double]
               ScaleData: [1x1 struct]
           FigureHandles: []