update rewards

This commit is contained in:
Brian Delhaisse
2019-03-27 02:03:41 +01:00
parent 31cdc46c52
commit 106d2b744d
3 changed files with 7 additions and 2 deletions
+2
View File
@@ -11,3 +11,5 @@ from .gym_reward import GymReward
# import costs
from .cost import *
# import processors
from .processors import *
@@ -0,0 +1,3 @@
# import reward processors
from .reward_processor import *
@@ -5,7 +5,8 @@ It processes the rewards before returning them; this can be useful to standardiz
"""
import numpy as np
from reward import Reward
from pyrobolearn.rewards.reward import Reward
__author__ = "Brian Delhaisse"
__copyright__ = "Copyright 2018, PyRoboLearn"
@@ -277,7 +278,6 @@ class ScaleRewardProcessor(RewardProcessor):
self.y2 = y2
self.ratio = (self.y2 - self.y1) / (self.x2 - self.x1)
@convert_numpy
def compute(self):
reward = self.reward()
self.value = self.y1 + (reward - self.x1) * self.ratio