The base class for most experience replay classes. It serves as a template for using it with the reinforcement learning models.
Creates a new base experience replay object.
BaseExperienceReplay.new(batchSize: number, numberOfRunsToUpdate: number, maxBufferSize: number)
batchSize: The number of experience to sample from for training.
numberOfRunsToUpdate: The number of run() function needed to be called to run a single event of experience replay.
maxBufferSize: The maximum number of experiences that can be kept inside the object.
Change the parameters of a base experience replay object.
BaseExperienceReplay:setParametersbatchSize: number, numberOfRunsToUpdate: number, maxBufferSize: number)
batchSize: The number of experience to sample from for training.
numberOfRunsToUpdate: The number of run() function needed to be called to run a single event of experience replay.
maxBufferSize: The maximum number of experiences that can be kept inside the object.
Adds new function on reset alongside with the current reset() function.
BaseExperienceReplay:setResetFunction(resetFunction)
Resets the base experience replay object.
BaseExperienceReplay:reset()
Sets the model’s run function.
BaseExperienceReplay:setRunFunction(updateFunction)
For every nth experience collected, it will run the updateFunction once.
BaseExperienceReplay:run(updateFunction)
Adds an experience to the experiance replay object.
BaseExperienceReplay:addExperience(previousFeatureVector, action: number/string, rewardValue: number, currentFeatureVector)
previousFeatureVector: The previous features of the environment.
action: The action selected.
rewardValue: The reward gained at current state.
currentFeatureVector: The currrent features of the environment.
Adds a temporal difference error to the experiance replay object.
BaseExperienceReplay:addTemporalDifferenceError(temporalDifferenceErrorVectorOrValue)
Set whether or not to store temporal difference errors to the experiance replay object.
BaseExperienceReplay:setIsTemporalDifferenceErrorRequired(option)