)
hit = (hit > 0).long()
- assert hit.min() == 0 and hit.max() <= 1
+ # assert hit.min() == 0 and hit.max() <= 1
rewards[:, t + 1] = -hit + (1 - hit) * agent[:, t + 1, -1, -1]
r = rewards[:, :, None]
rewards = (r + 1) + first_rewards_code
- assert (
- states.min() >= first_state_code
- and states.max() < first_state_code + nb_state_codes
- )
- assert (
- actions.min() >= first_actions_code
- and actions.max() < first_actions_code + nb_actions_codes
- )
- assert (
- rewards.min() >= first_rewards_code
- and rewards.max() < first_rewards_code + nb_rewards_codes
- )
+ # assert (
+ # states.min() >= first_state_code
+ # and states.max() < first_state_code + nb_state_codes
+ # )
+ # assert (
+ # actions.min() >= first_actions_code
+ # and actions.max() < first_actions_code + nb_actions_codes
+ # )
+ # assert (
+ # rewards.min() >= first_rewards_code
+ # and rewards.max() < first_rewards_code + nb_rewards_codes
+ # )
if lookahead_delta is None:
return torch.cat([states, actions, rewards], dim=2).flatten(1)
else:
- assert (
- lookahead_rewards.min() >= first_lookahead_rewards_code
- and lookahead_rewards.max()
- < first_lookahead_rewards_code + nb_lookahead_rewards_codes
- )
+ # assert (
+ # lookahead_rewards.min() >= first_lookahead_rewards_code
+ # and lookahead_rewards.max()
+ # < first_lookahead_rewards_code + nb_lookahead_rewards_codes
+ # )
return torch.cat([states, actions, rewards, lookahead_rewards], dim=2).flatten(
1
)