Home > dal > loss_sqd.m

loss_sqd

PURPOSE ^

loss_sqd - conjugate squared loss function

SYNOPSIS ^

function varargout = loss_sqd(aa, bb)

DESCRIPTION ^

 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Sat 22-Aug-2009 22:15:36 by m2html © 2003