├── README.md ├── SY2MY.m ├── iteration.m └── tutorial.pdf /README.md: -------------------------------------------------------------------------------- 1 | # iteration_algorithm_4_GroupL1Norm 2 | This project is the programming implement for "A Brief Tutorial on Group L1-norm" 3 | 4 | Please read "tutorial.pdf" for details. 5 | 6 | This algorithm can be used to solve the models in the following papers: 7 | 8 | 1. H. Wang, F. Nie, and H. Huang. Multi-view clustering and feature learning via structured sparsity. In ICML, 2013. 9 | [paper link](http://proceedings.mlr.press/v28/wang13c.pdf "please click") 10 | 11 | 2. P. Xu, Q. Yin, Y. Qi, Y.-Z. Song, Z. Ma, L. Wang, and J. Guo. Instance-level coupled subspace learning for fine-grained sketch-based image retrieval. In ECCV workshops, 2016. 12 | [paper link](http://www.pengxu.net/document/ECCV2016/ECCVW2016.pdf "please click") 13 | 14 | ## This project will be continuously updated! -------------------------------------------------------------------------------- /SY2MY.m: -------------------------------------------------------------------------------- 1 | function Y = SY2MY(Y) 2 | %%%%%%%%%%%%%%%%%%%%%%%% 3 | % Description: 4 | % Transform Y with single column to Y with the matrix representation. 5 | % 6 | % Parameters: 7 | % 8 | % Y - Single column, marked by 1 - k. 9 | % 10 | % Output: 11 | % 12 | % Y - with matrix representation, has k columns the column with +1 is 13 | % the affiliation of the the instances. 14 | % 15 | 16 | numI = size(Y,1); 17 | 18 | if size(Y,2) < 2 19 | u = unique(Y); 20 | k = length(u); 21 | 22 | if k >= 2 23 | newY = -ones(numI,k); 24 | for i = 1:length(u); 25 | newY(Y==u(i),u(i)) = 1; 26 | end 27 | else 28 | 29 | end 30 | Y = newY; 31 | end -------------------------------------------------------------------------------- /iteration.m: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % This is the MATLAB implement of the tutorial arxiv.org/xxxxxxx 3 | % 4 | % An Iterative algorithm for Group L1 norm 5 | % 6 | % definition of this interface: 7 | % input: 8 | % - X is the original data matrix defined in the tutorial. 9 | % - Label is the class label of input data X. 10 | % - lambda_1 is the hyper-parameter to adjust the weight of Group L1 norm regularizer. 11 | % - d_1 denotes the end position of the feature from view 1 12 | % - d_2 denotes the end position of the feature from view 2 13 | % - d_3 denotes the end position of the feature from view 3 14 | % output: 15 | % - W is the projection matrix W defined in the tutorial. 16 | % 17 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 18 | 19 | function [ W ] = iteration( X, Label, lambda_1, ite, d_1, d_2, d_3) 20 | tic; 21 | 22 | Y = SY2MY(Label); 23 | Y(find(Y == -1))=0; 24 | 25 | [dim, num] = size(X); 26 | [num, c] = size(Y); 27 | 28 | %%prepare for initialization 29 | I = eye(dim); 30 | 31 | %%set initial W as Eq.(8) in the tutorial 32 | W = (X * X' + 0.0000001 * I) \ (X * Y); 33 | 34 | 35 | %% iteration 36 | for n = 1 : ite 37 | 38 | for i = 1 : c 39 | 40 | w_1 = W(1 : d_1, i); 41 | w_2 = W(d_1 + 1 : d_2, i); 42 | w_3 = W(d_2 + 1 : d_3, i); 43 | 44 | w_1 = w_1.^2; 45 | w_2 = w_2.^2; 46 | w_3 = w_3.^2; 47 | 48 | % 0.0000001 serves as small perturbation 49 | v_1 = 1./ (2.* sqrt(sum(w_1) + 0.0000001)); 50 | v_2 = 1./ (2.* sqrt(sum(w_2) + 0.0000001)); 51 | v_3 = 1./ (2.* sqrt(sum(w_3) + 0.0000001)); 52 | 53 | 54 | v = [v_1 * ones(d_1, 1); v_2 * ones(d_2, 1); v_3 * ones(d_3, 1)]; 55 | 56 | D = diag(v); 57 | 58 | 59 | W( : , i) = (X * X'+ lambda_1 * D) \ (X * Y( : , i)); 60 | end; 61 | 62 | disp(n); 63 | end 64 | 65 | toc; 66 | end 67 | 68 | -------------------------------------------------------------------------------- /tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PengBoXiangShang/iteration_algorithm_4_GroupL1Norm/29bdae0e44259eae58053d43211cd3fabb4f43e2/tutorial.pdf --------------------------------------------------------------------------------