summaryrefslogtreecommitdiff
path: root/dtrain/test/mtm11/logreg_cd/bin_class.h
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2012-03-13 09:15:46 +0100
committerPatrick Simianer <p@simianer.de>2012-03-13 09:15:46 +0100
commit867bca3e5fa0cdd63bf032e5859fb5092d9a4ca1 (patch)
tree8504e2343429e8063ff645a6f7e30dd02df02c2a /dtrain/test/mtm11/logreg_cd/bin_class.h
parent07ab389e9f4034faebc2ad50146456223f5ab6bf (diff)
polish
Diffstat (limited to 'dtrain/test/mtm11/logreg_cd/bin_class.h')
-rw-r--r--dtrain/test/mtm11/logreg_cd/bin_class.h22
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