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
44 namespace Learn {
49 class ClassificationLearningEnvironment : public LearningEnvironment
50 {
51 protected:
60 std::vector<std::vector<uint64_t>> classificationTable;
61
68 uint64_t currentClass;
69
70 public:
78 ClassificationLearningEnvironment(uint64_t nbClass)
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
Learn::ClassificationLearningEnvironment
Specialization of the LearningEnvironment class for classification purposes.
Definition classificationLearningEnvironment.h:50
Learn::ClassificationLearningEnvironment::getClassificationTable
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
Learn::ClassificationLearningEnvironment::getScore
virtual double getScore() const override
Default scoring for classificationLearningEnvironment.
Definition classificationLearningEnvironment.cpp:57
Learn::ClassificationLearningEnvironment::classificationTable
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
Learn::ClassificationLearningEnvironment::reset
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
Learn::ClassificationLearningEnvironment::currentClass
uint64_t currentClass
Class of the current data.
Definition classificationLearningEnvironment.h:68
Learn::ClassificationLearningEnvironment::ClassificationLearningEnvironment
ClassificationLearningEnvironment(uint64_t nbClass)
Definition classificationLearningEnvironment.h:78
Learn::ClassificationLearningEnvironment::doAction
virtual void doAction(double actionID) override=0
Default implementation for the doAction method.
Definition classificationLearningEnvironment.cpp:42
Learn::LearningEnvironment
Interface for creating a Learning Environment.
Definition learningEnvironment.h:81
Learn
Definition adversarialEvaluationResult.h:45
Learn::LearningMode
LearningMode
Different modes in which the LearningEnvironment can be reset.
Definition learningEnvironment.h:59