Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdviviano committed Nov 29, 2023
1 parent cdffab1 commit 3b756a5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/gfn/gym/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(
action_shape=(1,), # [x_pos]
dummy_action=dummy_action,
exit_action=exit_action,
) # sf is -inf by defaukt.
) # sf is -inf by default.

def step(
self, states: States, actions: Actions
Expand Down Expand Up @@ -73,11 +73,6 @@ def is_action_valid(

def log_reward(self, final_states: States) -> TT["batch_shape", torch.float]:
s = final_states.tensor[..., 0]
# return torch.logsumexp(torch.stack([m.log_prob(s) for m in self.mixture], 0), 0)

# if s.nelement() == 0:
# return torch.zeros(final_states.batch_shape)

log_rewards = torch.empty((len(self.mixture),) + final_states.batch_shape)
for i, m in enumerate(self.mixture):
log_rewards[i] = m.log_prob(s)
Expand Down

0 comments on commit 3b756a5

Please sign in to comment.