This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |