SHOGUN  v3.1.1
 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 }
double norm(double *v, double p, int n)
Definition: epph.cpp:452
#define SG_NOTIMPLEMENTED
Definition: SGIO.h:141
virtual float64_t get_update(float64_t prediction, float64_t label, float64_t eta_t, float64_t norm)
float64_t loss(float64_t z)
double float64_t
Definition: common.h:48
float64_t second_derivative(float64_t z)
float64_t first_derivative(float64_t z)
virtual float64_t get_square_grad(float64_t prediction, float64_t label)

SHOGUN Machine Learning Toolbox - Documentation