src/seals/diagnostics/largest_sum.py
def reward(self, state: np.ndarray, act: int, next_state: np.ndarray) -> float:
        """Returns +1.0 reward when action is the right label and 0.0 otherwise."""
        n = self._length
        label = np.sum(state[: n // 2]) > np.sum(state[n // 2 :])
        return float(act == label)
Returns +1.0 reward when action is the right label and 0.0 otherwise.
Returns +1.0 reward when action is the right label and 0.0 otherwise.
Returns + 1 . 0 reward when action is the right label and 0 . 0 otherwise .
def reward(self, state: np.ndarray, act: int, next_state: np.ndarray) -> float:
        n = self._length
        label = np.sum(state[: n // 2]) > np.sum(state[n // 2 :])
        return float(act == label)
def reward ( self , state : np . ndarray , act : int , next_state : np . ndarray ) -> float : n = self . _length label = np . sum ( state [ : n // 2 ] ) > np . sum ( state [ n // 2 : ] ) return float ( act == label )
Returns +1.0 reward when action is the right label and 0.0 otherwise.
Returns + 1 . 0 reward when action is the right label and 0 . 0 otherwise .
"""Returns +1.0 reward when action is the right label and 0.0 otherwise."""
self
state
np.ndarray
act
int
next_state
np.ndarray