Skip to content

Commit

Permalink
Remove squeeze in DB loss
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhernandezgarcia committed Nov 28, 2023
1 parent 293010f commit 798b5ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gflownet/gflownet.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ def detailedbalance_loss(self, it, batch):
)

# Get logflows
logflow_states = self.state_flow(states_policy).squeeze()
logflow_states = self.state_flow(states_policy)
logflow_states[done.eq(1)] = torch.log(rewards)
# TODO: Optimise by reusing logflow_states and batch.get_parent_indices
logflow_parents = self.state_flow(parents_policy).squeeze()
logflow_parents = self.state_flow(parents_policy)

# Detailed balance loss
loss_all = (logflow_parents + logprobs_f - logflow_states - logprobs_b).pow(2)
Expand Down

0 comments on commit 798b5ef

Please sign in to comment.