본문 바로가기

Enginius/Machine Learning

Solving LMI using SeDuMi

minimize J
s.t
F0 + x1F1 + x2F2 + x3F3 + JF4 <0 with
F0=[2 3 2;3 5 2;2 2 4]
F1=[-2 2 1;2 0 0;1 0 0]
F2=[-4 -3 2;-3 4 1;2 1 0]
F3=[0 -2 0;-2 -4 2; 0 2 0]
F4=[0 0 0;0 0 0;0 0 -1]
X=[x1 x2;x2 x3]>0

라는 문제가 주어졌을 때 

C = [0;0;0;0;-F0(:)];
A = [-eye(4);F1(:) F2(:) F3(:) F4(:)];
b = [0 0 0 -1];
K.l = 4;
K.s = 3;
[primal,x] = sedumi(A,b,C,K)
% x are is your variables [x1 x2 x3 x4]

In more advanced cases, a modelling tool is recommended, such as
YALMIP <http://control.ee.ethz.ch/~joloef/wiki/pmwiki.php>
free, requires an SDP solver such as sedumi, sdpt3,dsdp,csdp,...)

Your YALMIP model would be

sdpvar x1 x2 x3 J
constr = set(F0 + x1*F1 + x2*F2 + x3*F3 + J*F4 <0) + set([x1 x2;x2
x3] >0);
solvesdp(constr,J)
double([x1 x2 x3 J])


'Enginius > Machine Learning' 카테고리의 다른 글

Deep Learning Rocks. still  (0) 2012.12.13
Reinforcement Learning  (10) 2012.12.04
Gaussian Mixture Model (vs k-means)  (0) 2012.11.20
Laplace Approximation  (0) 2012.10.19
papers - for seminar  (0) 2012.08.23