dopamine
dopamine copied to clipboard
atari_lib.py defining the neural network
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!

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.
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 .