diff options
author | Patrick Simianer <p@simianer.de> | 2011-11-21 12:21:08 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2011-11-21 12:21:08 +0100 |
commit | 574e2336348e5d3960b3232209d01845b40e6ea8 (patch) | |
tree | 958921d46db445acf3506a8f5620429682a4362a /dtrain/test/logreg_cd/bin_class.h | |
parent | 868d01c156914faaf85335c86374cc8f47a61b96 (diff) |
added pro stuff,clean up
Diffstat (limited to 'dtrain/test/logreg_cd/bin_class.h')
-rw-r--r-- | dtrain/test/logreg_cd/bin_class.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dtrain/test/logreg_cd/bin_class.h b/dtrain/test/logreg_cd/bin_class.h new file mode 100644 index 00000000..3466109a --- /dev/null +++ b/dtrain/test/logreg_cd/bin_class.h @@ -0,0 +1,22 @@ +#ifndef _BIN_CLASS_H_ +#define _BIN_CLASS_H_ + +#include <vector> +#include "sparse_vector.h" + +struct TrainingInstance { + // TODO add other info? loss for MIRA-type updates? + SparseVector<double> x_feature_map; + bool y; +}; + +struct Objective { + virtual ~Objective(); + + // returns f(x) and f'(x) + virtual double ObjectiveAndGradient(const SparseVector<double>& x, + const std::vector<TrainingInstance>& training_instances, + SparseVector<double>* g) const = 0; +}; + +#endif |