public class VanillaDiffVinit extends java.lang.Object implements DifferentiableVInit
ParametricFunction.ParametricStateActionFunction, ParametricFunction.ParametricStateFunction
Modifier and Type | Field and Description |
---|---|
protected DifferentiableRF |
rf
The differentiable reward function that defines the parameter space over which this value function
initialization must differentiate.
|
protected ValueFunction |
vinit
The source value function initialization.
|
Constructor and Description |
---|
VanillaDiffVinit(ValueFunction vinit,
DifferentiableRF rf)
Initializes.
|
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 ValueFunction vinit
protected DifferentiableRF rf
public VanillaDiffVinit(ValueFunction vinit, DifferentiableRF rf)
vinit
- The vanilla unparameterized value function initializationrf
- the differentiable reward function that defines the total parameter spacepublic 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 ParametricFunction copy()
ParametricFunction
ParametricFunction
.copy
in interface ParametricFunction
ParametricFunction
.public FunctionGradient valueGradient(State s)
DifferentiableValueFunction
valueGradient
in interface DifferentiableValueFunction
s
- the state on which the function is to be evaluatedpublic double value(State s)
ValueFunction
value
in interface ValueFunction
s
- the state to evaluate.