Comments (4)
Hi Ibrahim,
I am unsure of what you mean by the shared network being counted twice. If you are using A3C with one worker, then there should be two network initialized, one global network and one worker network.
from deeprl-agents.
Hi Arthur
I want to know exactly the number of trainable parameters ... I used this code
total_parameters = 0
for variable in tf.trainable_variables():
shape = variable.get_shape()
print(shape)
variable_parametes = 1
for dim in shape:
variable_parametes *= dim.value
total_parameters += variable_parametes
print(total_parameters)
and got this result above where this part is repeated twice:
(8, 8, 1, 16)
(16,)
(4, 4, 16, 32)
(32,)
My question is, how many trainable parameters are there in A3C code?
Thank you
from deeprl-agents.
The answer above accurately describes the total number of trainable parameters. But you need to keep into account that it is doubled the number of parameters actually ever being updated (or used for value and policy calculation).
from deeprl-agents.
Thanks @awjuliani
Could you please comment on this elaboration to ensure correct understanding?
I understand that the following:
1- each worker get a copy of the global network
2- each worker interacts with its environment and calculates loss and gradients
3- each worker updates the global network using gradients (not its local network)
4- go to step 1
So, if we have only one worker, we will have 2 identical networks:
1- global (where actual parameters updates take place)
2- local (worker) where environment interactions, loss and gradients are calculated (no parameter update for local networks)
This is why number of parameters increases when number of workers increases (because each worker has local copy of the network)
And the actual number of parameters that are actually updates is 2398816 / 2 (Number of parameters when using one worker divided by 2)
I hope this is correct
Finally, I would like to thank you for your excellent article
from deeprl-agents.
Related Issues (20)
- _ HOT 1
- simple and odd python problem HOT 2
- Double-Dueling-DQN: question about the rate to update target network
- Double-Dueling-DQN stops learning
- Can't see the source code. HOT 2
- checkGoal() in gridworld.py
- apply_gradients need a lock?
- A3C-Doom, is threading can make real parallelism?
- Please add more comments..
- Target network updates / Double-Dueling-DQN.ipynb HOT 1
- A3C Doom : function error
- DRQN plays FlappyBird
- what is the mean of multiply (1./(i+1))?
- Reward Smoothing
- A3C Doom: Why there should be no more workers than there are threads on CPU?
- How to do twice training session for the same buffer
- scipy.misc.imresize is deprecated in Scipy 1.14.3 --> modified code HOT 1
- A garbage code in Model-Network.ipynb
- Issue in DRQN
- Crash and burn in TF 2.0 and alter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deeprl-agents.