summaryrefslogtreecommitdiff
path: root/core/trainer.hpp
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2012-05-07 20:01:51 (GMT)
committerJan Huwald <jh@sotun.de>2012-05-07 20:01:51 (GMT)
commit420d2ef464d4a741028e132e662d5626806a41f5 (patch)
tree1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /core/trainer.hpp
Initial commitHEADmaster
Diffstat (limited to 'core/trainer.hpp')
-rw-r--r--core/trainer.hpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/core/trainer.hpp b/core/trainer.hpp
new file mode 100644
index 0000000..7f0d38c
--- /dev/null
+++ b/core/trainer.hpp
@@ -0,0 +1,52 @@
+#ifndef jB1MwurMlfU1OJE1w1IE29RFf9I
+#define jB1MwurMlfU1OJE1w1IE29RFf9I
+
+#include "event.hpp"
+#include "index.hpp"
+#include "pointers.hpp"
+#include "quant_types.hpp"
+#include "rng.hpp"
+#include "time.hpp"
+
+namespace TrainerImpl {
+
+struct TrainerT;
+
+template <typename PC, typename MI, typename MQ>
+struct Update;
+
+struct TrainerT {
+ explicit TrainerT(RNG::seed_t seed = RNG::seed_t(0));
+
+ template<typename PC, typename MI, typename MQ>
+ TrainerT update(PC &pc, MI &indices, MQ &queues, Time t) const {
+ return Update<PC, MI, MQ>::eval(*this, pc, indices, queues, t);
+ }
+
+ RNG::seed_t rng;
+ Time::type delay;
+ double reward,
+ performance;
+ uint64_t generation,
+ input, output;
+ uint32_t state,
+ resetCounter;
+};
+
+} // NS
+
+using TrainerImpl::TrainerT;
+
+namespace std {
+ ostream& operator<< (ostream &os, TrainerT val) {
+ return os
+ << "Trainer("
+ << val.generation << ", "
+ << val.state << ", "
+ << val.input << ", "
+ << val.output
+ << ")";
+ }
+}
+
+#endif // jB1MwurMlfU1OJE1w1IE29RFf9I
contact: Jan Huwald // Impressum