-
Notifications
You must be signed in to change notification settings - Fork 29
/
test.py
43 lines (26 loc) · 939 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'''
## Test ##
# Test a trained D4PG network. This can be run alongside training by running 'test_every_new_ckpt.py'.
@author: Mark Sinton ([email protected])
'''
import tensorflow as tf
import numpy as np
from params import test_params
from agent import Agent
def test():
# Set random seeds for reproducability
np.random.seed(test_params.RANDOM_SEED)
tf.set_random_seed(test_params.RANDOM_SEED)
# Create session
config = tf.ConfigProto(allow_soft_placement=True)
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
# Initialise agent
agent = Agent(sess, test_params.ENV, test_params.RANDOM_SEED)
# Build network
agent.build_network(training=False)
# Test network
agent.test()
sess.close()
if __name__ == '__main__':
test()