Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
class Qnetwork():
def __init__(self, h_size, number_of_actions=3):
# The network recieves a frame from the game, flattened into an array.
# It then resizes it and processes it through four convolutional layers.
self.scalarInput = tf.placeholder(shape=[None, 7056], dtype=tf.float32)
self.imageIn = tf.reshape(self.scalarInput, shape=[-1, 84, 84, 1])
self.conv1 = tf.contrib.layers.convolution2d( \
inputs=self.imageIn, num_outputs=32, kernel_size=[8, 8], stride=[4, 4], padding='VALID',