-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
31 lines (24 loc) · 848 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
import tensorflow as tf
from agents.td_leaf_agent import TDLeafAgent
from envs.chess import ChessEnv
from value_model import ValueModel
import time
import cProfile
def main():
config = tf.ConfigProto(device_count={'GPU': 0})
with tf.Session(config=config) as sess:
network = ValueModel()
env = ChessEnv()
agent = TDLeafAgent('tester_0', network, env, verbose=2)
agent.sess = sess
sess.run(tf.global_variables_initializer())
cProfile.runctx('agent.test(0, depth=3)', globals(), locals())
# for i in range(14):
# result = agent.test(i, depth=2)
# print(i, result)
# test_results = sess.run(agent.test_results)
# print(sum(test_results))
if __name__ == "__main__":
t0 = time.time()
main()
print('time:', time.time()-t0)