Skip to content

Commit 91b3cc7

Browse files
committed
Changed model to save only trainable variables. Added graph visualization.
1 parent 1553c95 commit 91b3cc7

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

Asynchronous/A3C.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
ENV_NAME = 'BreakoutDeterministic-v4'
1919
#ENV_NAME = 'PongDeterministic-v4'
2020
#MAX_ITERATIONS = 100000000
21-
MAX_EP_LENGTH = 1000
21+
MAX_EP_LENGTH = 100000
2222
#MAX_LEARNING_TIME = 7 * 60 * 60 # 7 hours
2323
LEARNING_RATE = 1e-4
24-
CLIP_VALUE = 10.0
24+
CLIP_VALUE = 2.0
2525

2626
def process_frame(x_t, img_rows, img_cols):
2727
x_t = skimage.color.rgb2gray(x_t)
@@ -366,12 +366,13 @@ def global_saving_thread(agent, sess):
366366

367367
global global_counter
368368

369-
MAX_MODELS = 3
369+
MAX_MODELS = 1000
370370
cnt_model = 0
371371

372372
with sess.as_default(), sess.graph.as_default():
373373

374-
saver = tf.train.Saver()
374+
collection = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, GLOBAL_SCOPE)
375+
saver = tf.train.Saver(collection)
375376

376377
elapsed_time = time.time() - start_time
377378

Asynchronous/A3C_no_lstm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88

99
IMG_WIDTH = 105
1010
IMG_HEIGHT = 80
11-
CNT_FRAMES = 4
11+
CNT_FRAMES = 3
1212
GLOBAL_SCOPE = 'global'
1313
VALUE_MODIFIER = 0.5*1e0
1414
POLICY_MODIFIER = 1*1e0
15-
ENTROPY_MODIFIER = 5*1e-3#2.5e-5#0.0005
15+
ENTROPY_MODIFIER = 2.5*1e-1#2.5e-5#0.0005
1616
MAX_STEPS = 30
1717
DISCOUNT = 0.99
1818
ENV_NAME = 'BreakoutDeterministic-v4'
1919
#ENV_NAME = 'PongDeterministic-v4'
20-
MAX_EP_LENGTH = 1000
20+
MAX_EP_LENGTH = 100000
2121
LEARNING_RATE = 1e-4
22-
CLIP_VALUE = 10.0
22+
CLIP_VALUE = 2.0
2323
DECAY = 0.99
2424
def process_frame(x_t, img_rows, img_cols):
2525
x_t = skimage.color.rgb2gray(x_t)
@@ -88,7 +88,7 @@ def __build_model(self):
8888

8989
#normalization = tf.layers.batch_normalization(embedding)
9090

91-
self.policy = tf.contrib.layers.fully_connected(embedding, self.action_size, activation_fn=tf.nn.softmax, weights_initializer=tf.random_normal_initializer(stddev=0.5), biases_initializer=None,\
91+
self.policy = tf.contrib.layers.fully_connected(embedding, self.action_size, activation_fn=tf.nn.softmax, weights_initializer=tf.random_normal_initializer(stddev=0.05), biases_initializer=None,\
9292
scope='fc_policy')
9393
self.value = tf.contrib.layers.fully_connected(\
9494
embedding, \

Asynchronous/start_tensorboard.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
tensorboard --logdir=local0:'./local0',local1:'./local1',local2:'./local2',local3:'./local3',local4:'./local4',local5:'./local5'
1+
tensorboard --logdir=local0:'./local0',local1:'./local1',local2:'./local2',local3:'./local3',local4:'./local4',local5:'./local5',graph:'./graph'

0 commit comments

Comments
 (0)