question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Two problem about update function

See original GitHub issue

I have two problem about update function after read your code. And could anyone explanation it for me? I am very appreciated. Firstly, I can’t understand what role does variable “num_sample” play when train q network?

# train q network
num_sample = 1
target_q = 0.0
for i in range(num_sample):
      target_act_next_n = [agents[i].p_debug['target_act'](obs_next_n[i]) for i in range(self.n)]
      target_q_next = self.q_debug['target_q_values'](*(obs_next_n + target_act_next_n))
      target_q += rew + self.args.gamma * (1.0 - done) * target_q_next
target_q /= num_sample

Secondly, why the loss of p should be loss = pg_loss + p_reg * 1e-3, and what role does p_reg play in the loss.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Ah31commented, Aug 6, 2019

p_reg is regularizing p_values obtained from the following:
p = p_func(p_input, int(act_pdtype_n[p_index].param_shape()[0]), scope="p_func", num_units=num_units). You can notice that p_values are being used to compute the pg_loss.

I don’t know yet why they have used num_sample because equalling it to 1 does not seem to do anything useful.

0reactions
hexbocommented, Mar 3, 2022

p_reg is regularizing p_values obtained from the following: p = p_func(p_input, int(act_pdtype_n[p_index].param_shape()[0]), scope="p_func", num_units=num_units). You can notice that p_values are being used to compute the pg_loss.

I don’t know yet why they have used num_sample because equalling it to 1 does not seem to do anything useful.

There is two variables both named i.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with Update Function Module - SAP Community
Hi All, I have been using an update FM in an implicit enhancement for COR2. this FM will update the date of manufacturer...
Read more >
update function problem - Unity Answers
my problem is that i keep getting this error MissingReferenceException: The object of type 'Transform' has been destroyed but you are still ...
Read more >
Concurrency problems in DBMS Transactions - GeeksforGeeks
When multiple transactions execute concurrently in an uncontrolled or unrestricted manner, then it might lead to several problems.
Read more >
Why React doesn't update state immediately - LogRocket Blog
When developing React applications, you may have noticed that state updates don't immediately reflect new values after being changed.
Read more >
Solved: If you have two c.server.updates inside one functi...
The reason of the problem: c.server.update() calls internally $http with the reference on $scope.data (c.data) as a parameter. The method $http processes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found