def __init__(self, policy, mdp_info, params): self.Q = Table(mdp_info.size) self._lambda = params['algorithm_params']['lambda'] trace = params.get('algorithm_params', 'replacing') self.e = EligibilityTrace(self.Q.shape, trace) super(SARSALambdaDiscrete, self).__init__(self.Q, policy, mdp_info, params)
def __init__(self, policy, mdp_info, learning_rate, lambda_coeff, trace='replacing'): """ Constructor. Args: lambda_coeff (float): eligibility trace coefficient; trace (str, 'replacing'): type of eligibility trace to use. """ self.Q = Table(mdp_info.size) self._lambda = lambda_coeff self.e = EligibilityTrace(self.Q.shape, trace) super().__init__(self.Q, policy, mdp_info, learning_rate)