-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.m
27 lines (23 loc) · 860 Bytes
/
demo.m
1
install();load ('data/synthetic.mat');% train LMNNL1 = lmnn2(x, y, 1, 'mu', 0.5, 'quiet', 1,'checkup',0);% train U-LMNNL2 = ulmnn2(u, x, y, 1, 'ep', 0, 'lambda', 2, 'mu', 0.5, 'quiet', 1,'checkup',0);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%y1 = -1.5; y2 = 1.5; x1 = -4; x2 = 4;hold on, axis square,set(gca,'Box', 'on',... 'XGrid', 'on',... 'YGrid', 'on' , ... 'YTick', y1:0.75:y2, ... 'XTick', x1:2:x2, ... 'LineWidth', 1, ... 'XLim',[x1 x2], ... 'YLim',[y1 y2]);hcont(1)= plotDecisionBoundary(u', x', y, L1, 'k', 1, x1, x2, y1, y2);hcont(2)= plotDecisionBoundary(u', x', y, L2, 'g',0, x1, x2, y1, y2);h = legend(hcont, 'LMNN', '$\mathcal{U}$-LMNN');set(h,'Interpreter','latex');clear;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%