API Reference - Models - TabularReinforcementLearningBaseModel

TabularReinforcementLearningBaseModel is a base class for tabular reinforcement learning models.

Constructors

new()

Creates a new base model object. If any of the arguments are nil, default argument values for that argument will be used.

TabularReinforcementLearningBaseModel.new(Model: TableObject, discountFactor: number): ModelObject

Parameters:

  • Model: The table object to be used.

  • discountFactor: The higher the value, the more likely it focuses on long-term outcomes. The value must be set between 0 and 1.

Returns:

  • ModelObject: The generated model object.

Functions

predict()

TabularReinforcementLearningBaseModel:predict(stateVector, returnOriginalOutput)

setCategoricalUpdateFunction()

Sets the model’s categorical policy update function.

TabularReinforcementLearningBaseModel:setCategoricalUpdateFunction(categoricalUpdateFunction)

Parameters:

  • categoricalUpdateFunction: The function to run when categoricalUpdate() is called.

setEpisodeUpdateFunction()

Sets the model’s episode update function.

TabularReinforcementLearningBaseModel:setEpisodeUpdateFunction(episodeUpdateFunction)

Parameters:

  • episodeUpdateFunction: The function to run when episodeUpdate() is called.

categoricalUpdate()

Updates the model parameters using categoricalUpdateFunction().

TabularReinforcementLearningBaseModel:categoricalUpdate(previousFeatureVector: featureVector, previousAction: number/string, rewardValue: number, currentFeatureVector: featureVector, currentAction: number/string, terminalStateValue: number)

Parameters:

  • previousFeatureVector: The previous state of the environment.

  • previousAction: The previous action selected.

  • rewardValue: The reward gained at current state.

  • currentFeatureVector: The current state of the environment.

  • currentAction: The current action selected.

  • terminalStateValue: A value of 1 indicates that the current state is a terminal state. A value of 0 indicates that the current state is not terminal.

episodeUpdate()

Updates the model parameters using episodeUpdateFunction().

TabularReinforcementLearningBaseModel:episodeUpdate()

setResetFunction()

Sets a new function on reset alongside with the current reset() function.

TabularReinforcementLearningBaseModel:setResetFunction(resetFunction)

Parameters:

  • resetFunction: The function to run when reset() is called.

reset()

Reset model’s stored values (excluding the parameters).

TabularReinforcementLearningBaseModel:reset()

Inherited From