SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GradientEvaluation.h
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  * Copyright (C) 2012 Jacob Walker
8  */
9 
10 
11 #ifndef CGRADIENTEVALUATION_H_
12 #define CGRADIENTEVALUATION_H_
13 
17 
18 namespace shogun
19 {
26 {
27 
28 public:
29 
30  /*Constructor*/
32 
40  CGradientEvaluation(CMachine* machine, CFeatures* features, CLabels* labels,
41  CEvaluation* evaluation_criterion, bool autolock = true);
42 
43  /*Destructor*/
44  virtual ~CGradientEvaluation();
45 
51  virtual const char* get_name() const
52  {
53  return "GradientEvaluation";
54  }
55 
56  /*Evaluates differentiable function for value
57  * and derivative.
58  *
59  * @return GradientResult containing value and
60  * gradient
61  */
62  virtual CEvaluationResult* evaluate();
63 
69  {
70  SG_REF(d);
71  SG_UNREF(m_diff);
72  m_diff = d;
73  };
74 
80  {
81  SG_REF(m_diff);
82  return m_diff;
83  };
84 
85 private:
86 
87  /*Initializer*/
88  void init();
89 
90 private:
91 
93 };
94 
95 } /* namespace shogun */
96 
97 #endif /* CGRADIENTEVALUATION_H_ */

SHOGUN Machine Learning Toolbox - Documentation