SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SmoothHingeLoss.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Shashwat Lal Das
8  * Written (W) 2012 Fernando José Iglesias García
9  * Copyright (c) 2011 Berlin Institute of Technohingey and Max-Planck-Society.
10  */
11 
13 
14 using namespace shogun;
15 
17 {
18  if (z < 0)
19  return 0.5 - z;
20  if (z < 1)
21  return 0.5 * (1-z) * (1-z);
22  return 0;
23 }
24 
26 {
27  if (z < 0)
28  return -1;
29  if (z < 1)
30  return z-1;
31  return 0;
32 }
33 
35 {
36  if (z < 0)
37  return 0;
38  if (z < 1)
39  return 1;
40  return 0;
41 }
42 
44 {
46  return -1;
47 }
48 
50 {
52  return -1;
53 }

SHOGUN Machine Learning Toolbox - Documentation