Modifies the model’s batch gradient descent to other modes.
When using “Stochastic” mode, make sure you set the model’s max number of iterations to 1.
batchSize is only applicable for “Minibatch” mode.
Creates a new gradient descent modifier object. If any of the arguments are not given, default argument values for that argument will be used.
GradientDescentModifier.new(Model: ModelObject, gradientDescentType: string, batchSize: integer, showOutput: boolean): GradientDescentModifierObject
Model: The model object to modify its gradient descent capabilities.
gradientDescentType: The type of gradient descent to be used when train() function is called. Available modes are “Batch”, “MiniBatch” and “Stochastic”.
batchSize: The batch size to split the featureMatirx and labelVector into multiple parts.
showOutput: Set whether or not to show the final cost for each epoch (MiniBatch) or data (Stochastic).
Set modifier’s parameters. When any of the arguments are not given, previous argument values for that argument will be used.
GradientDescentModifier:setParameters(Model: ModelObject, gradientDescentType: string, batchSize: integer, showOutput: boolean)
Model: The model object to modify its gradient descent capabilities.
gradientDescentType: The type of gradient descent to be used when train() function is called. Available modes are “Batch”, “MiniBatch” and “Stochastic”.
batchSize: The batch size to split the featureMatirx and labelVector into multiple parts.
showOutput: Set whether or not to show the final cost for each epoch (MiniBatch) or data (Stochastic).
Trains the machine/deep learning model under specific gradient descent mode.
GradientDescentModifier:train(...): number[]
Predict the values for given data.
GradientDescentModifier:predict(...): ...
…: The parameters are the same to the original model’s predict() function.
…: The outputs are the same to the original model’s predict() function.
Reward or punish model based on the current state of the environment.
ActorCritic:reinforce(currentFeatureVector: Matrix, rewardValue: number, returnOriginalOutput: boolean): integer, number -OR- Matrix
currentFeatureVector: Matrix containing data from the current state.
rewardValue: The reward value added/subtracted from the current state (recommended value between -1 and 1, but can be larger than these values).
returnOriginalOutput: Set whether or not to return predicted vector instead of value with highest probability.