SHOGUN  4.1.0
SquaredLoss.h
Go to the documentation of this file.
1 /*
3  embodied in the content of this file are licensed under the BSD
5
6  Copyright (c) 2011 Berlin Institute of Technology and Max-Planck-Society.
7
8  This program is free software; you can redistribute it and/or modify
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12
13  Modifications (w) 2011 Shashwat Lal Das
14  Modifications (w) 2012 Fernando José Iglesias García
15 */
16
17 #ifndef _SQUAREDLOSS_H__
18 #define _SQUAREDLOSS_H__
19
20 #include <shogun/lib/config.h>
21
23
24 namespace shogun
25 {
30 {
31 public:
36
41
50  float64_t loss(float64_t prediction, float64_t label);
51
60
69  float64_t first_derivative(float64_t prediction, float64_t label);
70
79
89
98
109  virtual float64_t get_update(float64_t prediction, float64_t label, float64_t eta_t, float64_t norm);
110
119  virtual float64_t get_square_grad(float64_t prediction, float64_t label);
120
126  virtual ELossType get_loss_type() { return L_SQUAREDLOSS; }
127
128  virtual const char* get_name() const { return "SquaredLoss"; }
129 };
130
131 }
132
133 #endif
double norm(double *v, double p, int n)
Definition: epph.cpp:452
virtual ELossType get_loss_type()
Definition: SquaredLoss.h:126
Class CLossFunction is the base class of all loss functions.
Definition: LossFunction.h:57
float64_t first_derivative(float64_t prediction, float64_t label)
Definition: SquaredLoss.cpp:32
virtual float64_t get_square_grad(float64_t prediction, float64_t label)
Definition: SquaredLoss.cpp:65
double float64_t
Definition: common.h:50
virtual const char * get_name() const
Definition: SquaredLoss.h:128
float64_t second_derivative(float64_t prediction, float64_t label)
Definition: SquaredLoss.cpp:42
CSquaredLoss implements the squared loss function.
Definition: SquaredLoss.h:29
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
float64_t loss(float64_t prediction, float64_t label)
Definition: SquaredLoss.cpp:22
virtual float64_t get_update(float64_t prediction, float64_t label, float64_t eta_t, float64_t norm)
Definition: SquaredLoss.cpp:52
ELossType
shogun loss type
Definition: LossFunction.h:28

SHOGUN Machine Learning Toolbox - Documentation