public class DenseStateActionLinearVFA extends java.lang.Object implements DifferentiableStateActionValue
ParametricFunction.ParametricStateActionFunction, ParametricFunction.ParametricStateFunction
Modifier and Type | Field and Description |
---|---|
protected double[] |
currentFeatures |
protected FunctionGradient |
currentGradient |
protected double |
currentValue |
protected double |
defaultWeight
A default weight value for the functions weights.
|
protected DenseStateActionFeatures |
features |
protected State |
lastState |
protected double[] |
stateActionWeights
The function weights when performing Q-value function approximation.
|
Constructor and Description |
---|
DenseStateActionLinearVFA(DenseStateActionFeatures features,
double defaultWeight) |
DenseStateActionLinearVFA(DenseStateActionFeatures features,
double[] stateActionWeights,
double defaultWeight) |
Modifier and Type | Method and Description |
---|---|
DenseStateActionLinearVFA |
copy()
Returns a copy of this
ParametricFunction . |
double |
evaluate(State s,
Action a)
|
double |
getParameter(int i)
Returns the value of the ith parameter value
|
FunctionGradient |
gradient(State s,
Action a)
Returns the gradient of this function.
|
int |
numParameters()
Returns the number of parameters defining this function.
|
void |
resetParameters()
Resets the parameters of this function to default values.
|
void |
setParameter(int i,
double p)
Sets the value of the ith parameter to given value
|
protected DenseStateActionFeatures features
protected double[] stateActionWeights
protected double defaultWeight
protected double[] currentFeatures
protected double currentValue
protected FunctionGradient currentGradient
protected State lastState
public DenseStateActionLinearVFA(DenseStateActionFeatures features, double defaultWeight)
public DenseStateActionLinearVFA(DenseStateActionFeatures features, double[] stateActionWeights, double defaultWeight)
public FunctionGradient gradient(State s, Action a)
DifferentiableStateActionValue
gradient
in interface DifferentiableStateActionValue
s
- the input State
a
- the input Action
FunctionGradient
of this function at the inputpublic double evaluate(State s, Action a)
ParametricFunction.ParametricStateActionFunction
evaluate
in interface ParametricFunction.ParametricStateActionFunction
s
- the input State
a
- the input actionState
and Action
public int numParameters()
ParametricFunction
numParameters
in interface ParametricFunction
public double getParameter(int i)
ParametricFunction
getParameter
in interface ParametricFunction
i
- the parameter indexpublic void setParameter(int i, double p)
ParametricFunction
setParameter
in interface ParametricFunction
i
- the index of the parameter to setp
- the parameter value to which it should be setpublic void resetParameters()
ParametricFunction
resetParameters
in interface ParametricFunction
public DenseStateActionLinearVFA copy()
ParametricFunction
ParametricFunction
.copy
in interface ParametricFunction
ParametricFunction
.