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 * Written (W) 2012 Fernando José Iglesias García 00009 * Copyright (c) 2011 Berlin Institute of Technology and Max-Planck-Society. 00010 */ 00011 00012 #ifndef _LOGLOSS_H__ 00013 #define _LOGLOSS_H__ 00014 00015 #include <shogun/loss/LossFunction.h> 00016 00017 namespace shogun 00018 { 00022 class CLogLoss: public CLossFunction 00023 { 00024 public: 00028 CLogLoss(): CLossFunction() {}; 00029 00033 ~CLogLoss() {}; 00034 00042 float64_t loss(float64_t z); 00043 00051 virtual float64_t first_derivative(float64_t z); 00052 00060 virtual float64_t second_derivative(float64_t z); 00061 00072 virtual float64_t get_update(float64_t prediction, float64_t label, float64_t eta_t, float64_t norm); 00073 00082 virtual float64_t get_square_grad(float64_t prediction, float64_t label); 00083 00089 virtual ELossType get_loss_type() { return L_LOGLOSS; } 00090 00091 virtual const char* get_name() const { return "LogLoss"; } 00092 }; 00093 00094 } 00095 00096 #endif