2012-12-31 24 views
4

我使用MATLAB中svmtrain去與MLP內核這樣的:matlab中的svmtrain - 約束不夠嚴格。

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

但我得到這個錯誤:

??? 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 - unable to solve the optimization problem答案如下:

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

但同樣我已經得到了同樣的錯誤。 我的訓練集是一個由2類數據點組成的簡單45 * 2數據集。

回答

0

here中的解決方案並沒有真正解釋任何內容。問題在於二次規劃方法無法收斂於優化問題。正常的操作過程是增加迭代次數,但我已經在相同大小的數據上進行了測試,並進行了1,000,000次迭代,但仍然無法收斂。

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做完全相同的事情工作正常:

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: []