public class LinearStateDiffVF extends java.lang.Object implements DifferentiableVInit
MLIRL.ParametricFunction.ParametricStateActionFunction, ParametricFunction.ParametricStateFunction| Modifier and Type | Field and Description |
|---|---|
protected int |
dim |
protected DenseStateFeatures |
fvgen
The state feature vector generator over which the linear function operates
|
protected double[] |
parameters |
| Constructor and Description |
|---|
LinearStateDiffVF(DenseStateFeatures fvgen,
int dim)
Initializes with the state feature vector generator over which the linear function is defined and the dimensionality of it.
|
| Modifier and Type | Method and Description |
|---|---|
ParametricFunction |
copy()
Returns a copy of this
ParametricFunction. |
double |
getParameter(int i)
Returns the value of the ith parameter value
|
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
|
double |
value(State s)
Returns the value function evaluation of the given state.
|
FunctionGradient |
valueGradient(State s)
Returns the gradient of this value function
|
protected DenseStateFeatures fvgen
protected int dim
protected double[] parameters
public LinearStateDiffVF(DenseStateFeatures fvgen, int dim)
fvgen - the state feature vector generator over which the linear function is defined.dim - the dimensionality of the feature vector/parameterspublic int numParameters()
ParametricFunctionnumParameters in interface ParametricFunctionpublic double getParameter(int i)
ParametricFunctiongetParameter in interface ParametricFunctioni - the parameter indexpublic void setParameter(int i,
double p)
ParametricFunctionsetParameter in interface ParametricFunctioni - the index of the parameter to setp - the parameter value to which it should be setpublic void resetParameters()
ParametricFunctionresetParameters in interface ParametricFunctionpublic ParametricFunction copy()
ParametricFunctionParametricFunction.copy in interface ParametricFunctionParametricFunction.public FunctionGradient valueGradient(State s)
DifferentiableValueFunctionvalueGradient in interface DifferentiableValueFunctions - the state on which the function is to be evaluatedpublic double value(State s)
ValueFunctionvalue in interface ValueFunctions - the state to evaluate.