Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
albertbou92 committed Apr 23, 2024
1 parent 5eed34e commit 160dd89
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion scripts/reinforce/config_scaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ model: gru # gru, lstm, or gpt2
lr: 0.0001
eps: 1.0e-08
weight_decay: 0.0

2 changes: 1 addition & 1 deletion scripts/reinforce/reinforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def compute_loss(data, model):
agent_log_prob = get_log_prob(data, model)
agent_likelihood = (agent_log_prob * mask).sum(-1)
reward = data.get(("next", "reward")).squeeze(-1).sum(-1)
loss = - agent_likelihood * reward
loss = -agent_likelihood * reward

return data, loss

Expand Down

0 comments on commit 160dd89

Please sign in to comment.