public class DiffVFRF extends java.lang.Object implements DifferentiableRF
MLIRL
when
the reward function is known, but the value function initialization for leaf nodes is to be learned.
This class takes as input the true reward function and a DifferentiableVInit
object to form the DifferentiableRF
object
that MLIRL
will use.ParametricFunction.ParametricStateActionFunction, ParametricFunction.ParametricStateFunction
Modifier and Type | Field and Description |
---|---|
protected DifferentiableVInit |
diffVInit |
protected int |
dim |
protected RewardFunction |
objectiveRF |
Constructor and Description |
---|
DiffVFRF(RewardFunction objectiveRF,
DifferentiableVInit diffVinit) |
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 |
gradient(State s,
Action a,
State sprime) |
int |
numParameters()
Returns the number of parameters defining this function.
|
void |
resetParameters()
Resets the parameters of this function to default values.
|
double |
reward(State s,
Action a,
State sprime)
Returns the reward received when action a is executed in state s and the agent transitions to state sprime.
|
void |
setParameter(int i,
double p)
Sets the value of the ith parameter to given value
|
protected RewardFunction objectiveRF
protected DifferentiableVInit diffVInit
protected int dim
public DiffVFRF(RewardFunction objectiveRF, DifferentiableVInit diffVinit)
public FunctionGradient gradient(State s, Action a, State sprime)
gradient
in interface DifferentiableRF
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 ParametricFunction copy()
ParametricFunction
ParametricFunction
.copy
in interface ParametricFunction
ParametricFunction
.public double reward(State s, Action a, State sprime)
RewardFunction
reward
in interface RewardFunction
s
- the state in which the action was executeda
- the action executedsprime
- the state to which the agent transitioned