public class VanillaDiffVinit extends java.lang.Object implements DifferentiableVInit
ValueFunctionInitialization.ConstantValueFunctionInitializationParametricFunction.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 ValueFunctionInitialization |
vinit
The source value function initialization.
|
| Constructor and Description |
|---|
VanillaDiffVinit(ValueFunctionInitialization 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
|
FunctionGradient |
getQGradient(State s,
AbstractGroundedAction ga)
Returns the Q-value function gradient.
|
FunctionGradient |
getVGradient(State s)
Returns the value function gradient.
|
int |
numParameters()
Returns the number of parameters defining this function.
|
double |
qValue(State s,
AbstractGroundedAction a)
Returns the initialization value of the Q-value function for a given state and action pair.
|
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.
|
protected ValueFunctionInitialization vinit
protected DifferentiableRF rf
public VanillaDiffVinit(ValueFunctionInitialization vinit, DifferentiableRF rf)
vinit - The vanilla unparameterized value function initializationrf - the differentiable reward function that defines the total parameter spacepublic 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 getVGradient(State s)
DifferentiableVInitgetVGradient in interface DifferentiableVInits - the state on which the value function is to be evaluatedpublic FunctionGradient getQGradient(State s, AbstractGroundedAction ga)
DifferentiableVInitgetQGradient in interface DifferentiableVInits - the state on which the Q-value is to be evaluated.ga - the action on which the Q-value is to be evaluated.public double value(State s)
ValueFunctionvalue in interface ValueFunctions - the state to evaluate.public double qValue(State s, AbstractGroundedAction a)
ValueFunctionInitializationqValue in interface ValueFunctionInitializations - the state for which to get the initial value of the Q-value function.a - the action for which to get the initial value of the Q-value function.