23 #ifndef SRC_ALGORITHMS_EPERIENCEREPLAYTABLE_HPP_
24 #define SRC_ALGORITHMS_EPERIENCEREPLAYTABLE_HPP_
26 #include <types/Batch.hpp>
27 #include <types/Position2D.hpp>
28 #include <types/MatrixTypes.hpp>
40 mic::types::Position2D
s_t;
43 mic::types::NESWAction
a_t;
54 SpatialExperience(mic::types::Position2D s_t_, mic::types::NESWAction a_t_, mic::types::Position2D s_t_prim_) {
110 virtual void add(std::shared_ptr<mic::types::SpatialExperience> input_, std::shared_ptr<mic::types::MatrixXf> target_) {
114 std::uniform_int_distribution<> index_dist(0, this->sample_data.size()-1);
117 unsigned int tmp_index= index_dist(rng_mt19937_64);
120 sample_data.erase (sample_data.begin()+tmp_index);
121 sample_labels.erase (sample_labels.begin()+tmp_index);
122 sample_indices.erase (sample_indices.begin()+tmp_index);
126 sample_data.push_back(input_);
127 sample_labels.push_back(target_);
128 sample_indices.push_back(sample_indices.size());
virtual void add(std::shared_ptr< mic::types::SpatialExperience > input_, std::shared_ptr< mic::types::MatrixXf > target_)
std::shared_ptr< mic::types::SpatialExperience > SpatialExperiencePtr
Shared pointer to spatial experience object.
mic::types::NESWAction a_t
Action at time t.
Structure storing a spatial experience - a triplet of position in time t, executed action and positio...
SpatialExperience(mic::types::Position2D s_t_, mic::types::NESWAction a_t_, mic::types::Position2D s_t_prim_)
SpatialExperienceMemory(size_t number_of_experiences_, size_t batch_size_)
size_t number_of_experiences
Size of the experience table (maximum number of stored experiences).
mic::types::Position2D s_t
State at time t.
virtual ~SpatialExperienceMemory()
mic::types::Batch< mic::types::SpatialExperience, mic::types::MatrixXf > SpatialExperienceBatch
Spatial experience replay batch.
mic::types::Position2D s_t_prim
State at time t+1 (t prim).
mic::types::Sample< mic::types::SpatialExperience, mic::types::MatrixXf > SpatialExperienceSample
Spatial experience replay sample.
Class representing the spatial experience memory - used in memory replay. Derived from the Batch clas...