SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 #include <shogun/io/SGIO.h>
14 
15 using namespace shogun;
16 
18 {
19  if (z < 0)
20  return 0.5 - z;
21  if (z < 1)
22  return 0.5 * (1-z) * (1-z);
23  return 0;
24 }
25 
27 {
28  if (z < 0)
29  return -1;
30  if (z < 1)
31  return z-1;
32  return 0;
33 }
34 
36 {
37  if (z < 0)
38  return 0;
39  if (z < 1)
40  return 1;
41  return 0;
42 }
43 
45 {
47  return -1;
48 }
49 
51 {
53  return -1;
54 }
double norm(double *v, double p, int n)
Definition: epph.cpp:452
#define SG_NOTIMPLEMENTED
Definition: SGIO.h:139
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:50
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
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