Title: Dueling question · Issue #4 · pythonlessons/Reinforcement_Learning · GitHub
Open Graph Title: Dueling question · Issue #4 · pythonlessons/Reinforcement_Learning
X Title: Dueling question · Issue #4 · pythonlessons/Reinforcement_Learning
Description: Hello, Thanks for a great project. It's very useful. I have a question on the model code related to the Dueling algorithm. For example: Pong-v0_DQN_CNN_TF2.py Here is an example of the code: action_advantage = Lambda(lambda a: a[:, :] - ...
Open Graph Description: Hello, Thanks for a great project. It's very useful. I have a question on the model code related to the Dueling algorithm. For example: Pong-v0_DQN_CNN_TF2.py Here is an example of the code: action...
X Description: Hello, Thanks for a great project. It's very useful. I have a question on the model code related to the Dueling algorithm. For example: Pong-v0_DQN_CNN_TF2.py Here is an example of the code: ac...
Opengraph URL: https://github.com/pythonlessons/Reinforcement_Learning/issues/4
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dueling question","articleBody":"Hello,\r\nThanks for a great project. It's very useful. I have a question on the model code related to the Dueling algorithm. For example:\r\n**Pong-v0_DQN_CNN_TF2.py**\r\n\r\nHere is an example of the code:\r\n`action_advantage = Lambda(lambda a: a[:, :] - K.mean(a[:, :], keepdims=True), output_shape=(action_space,))(action_advantage)`\r\n\r\nlet's say our batch looks like this:\r\n`a = tf.constant([[1.0, 2.0], [-2.0, 3.0], [3.0, -4.0]])`\r\n`print('a=', a)`\r\na= tf.Tensor(\r\n[[ 1. 2.]\r\n [-2. 3.]\r\n [ 3. -4.]], shape=(3, 2), dtype=float32)\r\n\r\nThe result of the \"K.mean\" function will be a tensor with shape (1, 1):\r\n`print('Kmean=', K.mean(a[:, :], keepdims=True))`\r\nKmean= tf.Tensor([[0.5]], shape=(1, 1), dtype=float32)\r\n\r\nShouldn't there be a tensor with shape (3, 1)?\r\n`print('Kmean=', K.mean(a[:, :], axis=1, keepdims=True))`\r\nKmean= tf.Tensor(\r\n[[ 1.5]\r\n [ 0.5]\r\n [-0.5]], shape=(3, 1), dtype=float32)\r\n\r\nIf we assume that our batch contains 3 elements, then the mean value should be calculated for each element in the batch separately. Or am I missing something ?","author":{"url":"https://github.com/rustequal","@type":"Person","name":"rustequal"},"datePublished":"2020-12-18T23:00:42Z","url":"https://github.com/pythonlessons/Reinforcement_Learning/issues/4"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8acc905c-d598-3dae-9148-bde42d038864 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B316:2BE37C:1DA4636:26E3E94:6B041535 |
| html-safe-nonce | 2235a2562719abf4e3f7d9adad2ff1c5510c38bd5ceb503a96557b56e5322313 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzE2OjJCRTM3QzoxREE0NjM2OjI2RTNFOTQ6NkIwNDE1MzUiLCJ2aXNpdG9yX2lkIjoiNTg4MDA5Njk1MzQ0NjE3NjA1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e7804f02615e047162c218505d32f02fd208ac885eba645a2dd674197fb29cd3 |
| hovercard-subject-tag | issue:771224004 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonlessons/Reinforcement_Learning/4/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9a63f14db177ca39e6673a469a88bd234aa2c526b4c9735cc8b04335acfe1d8c/pythonlessons/Reinforcement_Learning/issues/4 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9a63f14db177ca39e6673a469a88bd234aa2c526b4c9735cc8b04335acfe1d8c/pythonlessons/Reinforcement_Learning/issues/4 |
| og:image:alt | Hello, Thanks for a great project. It's very useful. I have a question on the model code related to the Dueling algorithm. For example: Pong-v0_DQN_CNN_TF2.py Here is an example of the code: action... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rustequal |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonlessons/Reinforcement_Learning git https://github.com/pythonlessons/Reinforcement_Learning.git |
| octolytics-dimension-user_id | 43852392 |
| octolytics-dimension-user_login | pythonlessons |
| octolytics-dimension-repository_id | 233614411 |
| octolytics-dimension-repository_nwo | pythonlessons/Reinforcement_Learning |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 233614411 |
| octolytics-dimension-repository_network_root_nwo | pythonlessons/Reinforcement_Learning |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width