loss_sqd - conjugate squared loss function Syntax: [floss, gloss, hloss, hmin]=loss_sqd(aa, bb) Copyright(c) 2009 Ryota Tomioka This software is distributed under the MIT license. See license.txt
0001 % loss_sqd - conjugate squared loss function 0002 % 0003 % Syntax: 0004 % [floss, gloss, hloss, hmin]=loss_sqd(aa, bb) 0005 % 0006 % Copyright(c) 2009 Ryota Tomioka 0007 % This software is distributed under the MIT license. See license.txt 0008 function varargout = loss_sqd(aa, bb) 0009 0010 gloss = aa-bb; 0011 floss = 0.5*sum(gloss.^2)-0.5*sum(bb.^2); 0012 hloss = spdiag(ones(size(aa))); 0013 hmin = 1; 0014 0015 if nargout<=3 0016 varargout = {floss, gloss, hmin}; 0017 else 0018 varargout = {floss, gloss, hloss, hmin}; 0019 end 0020