-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSpaceInvaders.py
46 lines (35 loc) · 1.19 KB
/
SpaceInvaders.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
44
45
46
""" """
#incorporate use-input dictionary etc.
from train import train
from setup import setup
from build_graph import init_graph
from helper import setup_saver
import tensorflow as tf
def main():
""" Main function. All operations start from within here """
env, parameter = setup()
tf.reset_default_graph()
#model_vars
#W, b, input, Qout, predict, nextQ, loss, trainer, updateModel = init_graph()
W, b, forward_dict, loss_dict = init_graph()
# forward_dict = {"input":input,
# "Qout":Qout,
# "predict":predict
# }
# loss_dict = {"nextQ": nextQ,
# "loss": loss,
# "trainer":trainer,
# "updateModel":updateModel
# }
saver = setup_saver(W, b)
reward_list, steps_list = train(
env=env,
parameter=parameter,
saver=saver,
forward_dict=forward_dict,
loss_dict=loss_dict
)
if __name__ == '__main__':
main()
# import cProfile
# cProfile.run('main()', 'restats')