Skip to content

Commit c93b217

Browse files
committed
clean sac_discrete
1 parent 02ecae2 commit c93b217

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

sac_discrete.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,7 @@ def update(self, batch_size, reward_scale=10., auto_entropy=True, target_entropy
198198
with torch.no_grad():
199199
predicted_new_q_value = torch.min(self.soft_q_net1(state),self.soft_q_net2(state))
200200
policy_loss = (log_prob.exp()*(self.alpha * log_prob - predicted_new_q_value)).sum(dim=-1).mean()
201-
if torch.isnan(policy_loss):
202-
print(log_prob, predicted_new_q_value, state)
203-
print('q: ', q_value_loss1, q_value_loss2, target_q_value, target_q_min, next_log_prob, predicted_q_value1, predicted_q_value2)
204-
201+
205202
self.policy_optimizer.zero_grad()
206203
policy_loss.backward()
207204
self.policy_optimizer.step()

sac_v2.png

4.66 KB
Loading

0 commit comments

Comments
 (0)