GEGELATI
Loading...
Searching...
No Matches
classificationLearningEnvironment.h
1
37#ifndef CLASSIFICATION_LEARNING_ENVIRONMENT_H
38#define CLASSIFICATION_LEARNING_ENVIRONMENT_H
39
40#include <vector>
41
42#include "learn/learningEnvironment.h"
43
44namespace Learn {
50 {
51 protected:
60 std::vector<std::vector<uint64_t>> classificationTable;
61
68 uint64_t currentClass;
69
70 public:
79 : LearningEnvironment(nbClass), currentClass{0},
80 classificationTable(nbClass, std::vector<uint64_t>(nbClass, 0)){};
81
86 const std::vector<std::vector<uint64_t>>& getClassificationTable()
87 const;
88
96 virtual void doAction(double actionID) override = 0;
97
106 virtual double getScore() const override;
107
113 virtual void reset(size_t seed = 0,
114 LearningMode mode = LearningMode::TRAINING,
115 uint16_t iterationNumber = 0,
116 uint64_t generationNumber = 0) override = 0;
117 };
118}; // namespace Learn
119
120#endif
Specialization of the LearningEnvironment class for classification purposes.
Definition classificationLearningEnvironment.h:50
const std::vector< std::vector< uint64_t > > & getClassificationTable() const
Get a const ref to the classification table of the learning environment.
Definition classificationLearningEnvironment.cpp:52
virtual double getScore() const override
Default scoring for classificationLearningEnvironment.
Definition classificationLearningEnvironment.cpp:57
std::vector< std::vector< uint64_t > > classificationTable
2D array storing for each class the guesses that were made by the LearningAgent.
Definition classificationLearningEnvironment.h:60
virtual void reset(size_t seed=0, LearningMode mode=LearningMode::TRAINING, uint16_t iterationNumber=0, uint64_t generationNumber=0) override=0
Default implementation of the reset.
Definition classificationLearningEnvironment.cpp:98
uint64_t currentClass
Class of the current data.
Definition classificationLearningEnvironment.h:68
ClassificationLearningEnvironment(uint64_t nbClass)
Definition classificationLearningEnvironment.h:78
virtual void doAction(double actionID) override=0
Default implementation for the doAction method.
Definition classificationLearningEnvironment.cpp:42
Interface for creating a Learning Environment.
Definition learningEnvironment.h:81
Definition classificationLearningEnvironment.h:44
LearningMode
Different modes in which the LearningEnvironment can be reset.
Definition learningEnvironment.h:59