dopamine icon indicating copy to clipboard operation
dopamine copied to clipboard

atari_lib.py defining the neural network

Open sunchipsster1 opened this issue 5 years ago • 2 comments

Hello! I am very interesting in looking into the architecture of the DQNs. I opened up the file the Dopamine group kindly provided in Discrete_Domains --> atari_lib.py which defines the neural networks from the original Nature paper.

I was wondering why-- for each neural architecture -- two neural equivalent neural nets, one set as a definition and the other set as a class, are provided (see image below)? What would happen if one had just defined the class, for instance? I apologize if this is a very noob question, but thank you very much in advance for the insight!

image

sunchipsster1 avatar Dec 23 '19 06:12 sunchipsster1

According to the screenshots you have provided, those two are not related.

The first one (function definiton) uses the low-level API of Tensorflow to create the network, while the second uses Keras, a high-level, abstract API for Tensorflow.

The two are also equivalent, which one you use depends on how you want to implement the algorithm, namely the syntax and structure of the code.

dosssman avatar Dec 25 '19 00:12 dosssman

Hi,

The first one is the legacy network function and will likely to be removed in the future. You should use the second method to define networks: i.e. tf.keras.Model.

Dopamine switch to the Keras API in September with this commit .

evcu avatar Feb 04 '20 03:02 evcu