00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2011 Shashwat Lal Das 00008 * Copyright (c) 2011 Berlin Institute of Technology and Max-Planck-Society. 00009 */ 00010 00011 #ifndef _LOGLOSSMARGIN_H__ 00012 #define _LOGLOSSMARGIN_H__ 00013 00014 #include <shogun/loss/LossFunction.h> 00015 00016 namespace shogun 00017 { 00021 class CLogLossMargin: public CLossFunction 00022 { 00023 public: 00027 CLogLossMargin(): CLossFunction() {}; 00028 00032 ~CLogLossMargin() {}; 00033 00042 float64_t loss(float64_t prediction, float64_t label); 00043 00052 virtual float64_t first_derivative(float64_t prediction, float64_t label); 00053 00062 virtual float64_t second_derivative(float64_t prediction, float64_t label); 00063 00074 virtual float64_t get_update(float64_t prediction, float64_t label, float64_t eta_t, float64_t norm); 00075 00084 virtual float64_t get_square_grad(float64_t prediction, float64_t label); 00085 00091 virtual ELossType get_loss_type() { return L_LOGLOSSMARGIN; } 00092 00093 virtual const char* get_name() const { return "LogLossMargin"; } 00094 }; 00095 00096 } 00097 00098 #endif