diff options
author | Patrick Simianer <p@simianer.de> | 2012-03-13 09:15:46 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2012-03-13 09:15:46 +0100 |
commit | 10a232656a0c882b3b955d2bcfac138ce11e8a2e (patch) | |
tree | 134e2637908cd85b3548d68ac8590f3aad8d1c49 /dtrain/test/mtm11/logreg_cd/bin_class.h | |
parent | e77078e31cd75f0e5983d332b990809a3644b0fb (diff) |
polish
Diffstat (limited to 'dtrain/test/mtm11/logreg_cd/bin_class.h')
-rw-r--r-- | dtrain/test/mtm11/logreg_cd/bin_class.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dtrain/test/mtm11/logreg_cd/bin_class.h b/dtrain/test/mtm11/logreg_cd/bin_class.h new file mode 100644 index 00000000..3466109a --- /dev/null +++ b/dtrain/test/mtm11/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 |