#ifndef _BIN_CLASS_H_ #define _BIN_CLASS_H_ #include #include "sparse_vector.h" struct TrainingInstance { // TODO add other info? loss for MIRA-type updates? SparseVector x_feature_map; bool y; }; struct Objective { virtual ~Objective(); // returns f(x) and f'(x) virtual double ObjectiveAndGradient(const SparseVector& x, const std::vector& training_instances, SparseVector* g) const = 0; }; #endif