Mercurial > hg > camir-aes2014
comparison toolboxes/distance_learning/mlr/regularize/regularizeMKLDiag.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function r = regularizeMKLDiag(W, X, gradient) | |
2 % | |
3 % r = regularizeMKL(W, X, gradient) | |
4 % | |
5 % | |
6 | |
7 [d,n,m] = size(X); | |
8 | |
9 if gradient | |
10 r = zeros(d,m); | |
11 for i = 1:m | |
12 r(:,i) = diag(X(:,:,i)); | |
13 end | |
14 else | |
15 r = 0; | |
16 for i = 1:m | |
17 r = r + W(:,i)' * diag(X(:,:,i)); | |
18 end | |
19 end | |
20 end |