DataPredict

API Reference - QuickSetups - CategoricalPolicy

CategoricalPolicy is a base class for setuping up reinforcement learning functions.

Constructors

new()

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

CategoricalPolicy.new(numberOfReinforcementsPerEpisode: integer, epsilon: number, actionSelectionFunction: string): CategoricalPolicyObject

Parameters:

Returns:

Functions

setParameters()

Set model’s parameters. When any of the arguments are nil, previous argument values for that argument will be used.

CategoricalPolicy:setParameters(numberOfReinforcementsPerEpisode: integer, epsilon: number, actionSelectionFunction: string)

Parameters:

setModel()

CategoricalPolicy:setModel(Model: ModelObject)

Parameters:

getModel()

CategoricalPolicy:getModel(): ModelObject

Returns:

setExperienceReplay()

CategoricalPolicy:setExperienceReplay(ExperienceReplay: ExperienceReplayObject)

Parameters:

getExperienceReplay()

CategoricalPolicy:getExperienceReplay(): ExperienceReplayObject

Returns:

setEpsilonValueScheduler()

CategoricalPolicy:setEpsilonValueScheduler(EpsilonValueScheduler: ValueSchedulerObject)

Parameters:

getEpsilonValueScheduler()

CategoricalPolicy:getEpsilonVaueScheduler(): ValueSchedulerObject

Returns:

setClassesList()

CategoricalPolicy:setClassesList(classesList: [])

Parameters:

getClassesList()

Gets all the classes stored in the NeuralNetwork model.

CategoricalPolicy:getClassesList(): []

Returns:

extendUpdateFunction()

Sets a new function on update alongside with the current model’s update() function.

CategoricalPolicy:extendUpdateFunction(updateFunction)

Parameters:

extendEpisodeUpdateFunction()

Sets a new function on episode update alongside with the current model’s episodeUpdate() function.

CategoricalPolicy:extendEpisodeUpdateFunction(episodeUpdateFunction)

Parameters:

reinforce()

Reward or punish model based on the current state of the environment.

CategoricalPolicy:reinforce(currentFeatureVector: Matrix, rewardValue: number, returnOriginalOutput: boolean): integer, number -OR- Matrix

Parameters:

Returns:

-OR-

reset()

Resets the current parameters values.

CategoricalPolicy:reset()

setPrintOutput()

Set whether or not to show the current number of episodes and current epsilon.

CategoricalPolicy:setPrintOutput(option: boolean)

Parameters:

getCurrentNumberOfEpisodes()

CategoricalPolicy:getCurrentNumberOfEpisodes(): integer

Returns

getCurrentNumberOfReinforcements()

CategoricalPolicy:getCurrentNumberOfReinforcements(): integer

Returns

getCurrentEpsilon()

CategoricalPolicy:getCurrentEpsilon(): number

Returns