Commit f49ff8cb authored by Ibrahim Ahmed's avatar Ibrahim Ahmed
Browse files

baseline_control: Action clip to starting actions in SimpleFeedbackController

parent b9e8e26d
Loading
Loading
Loading
Loading
+4 −3
Changes for src/baseline_control.py: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ class SimpleFeedbackController(BaseEstimator):

        if len(self._actions) < 2:
            action = self.starting_action(X)
            action = self.clip_action(action, X)
            self._actions.append(action)
            step_action = self._actions[-1] - self._actions[-min(2, len(self._actions))]
        else:
@@ -212,13 +213,13 @@ class SimpleFeedbackController(BaseEstimator):
        return action,


    def feedback(self, X: np.ndarray) -> float:
    def feedback(self, X: pd.DataFrame) -> float:
        raise NotImplementedError('Subclass and overide this method.')


    def starting_action(self, X: np.ndarray):
    def starting_action(self, X: pd.DataFrame):
        raise NotImplementedError('Subclass and overide this method.')


    def clip_action(self, u: Union[np.ndarray, float, int], X: np.ndarray):
    def clip_action(self, u: Union[np.ndarray, float, int], X: pd.DataFrame):
        return np.clip(u, a_min=self.bounds[:, 0], a_max=self.bounds[:, 1])
 No newline at end of file
+2 −2

File changed.

Contains only whitespace changes.