-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
119 lines (112 loc) · 10.9 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import time
from argparse import Namespace
import environment as brisc
from graphic_visualizations import training_summary
from utils import BriscolaLogger
def train():
x = []
y = []
for i in range(0, 90):
x.append(i * 1000)
y.append([740, 260])
labels = ['QLearningAgent', 'RandomAgent']
args = Namespace(against='RandomAgent', agent='QLearningAgent', checkpoint_path=None, discount=0.95, episodes=50000,
epsilon=1.0, epsilon_decay_rate=0.999998, evaluate_every=1000, lr=0.0001, minimum_epsilon=0.1,
num_evaluation=1000, path='models/QLearningAgent_1687693168.pt', replace_every=1000,
winning_reward=100)
training_summary(x, y,
[[[32, 65, 54, 76, 103, 68, 114, 114, 51, 70, 52, 102, 71, 83, 83, 90, 56, 85, 54, 56, 73,
90, 48, 86, 87, 65, 103, 65, 103, 100, 83, 98, 69, 43, 74, 76, 48, 67, 49, 85, 77, 67,
88, 62, 70, 90, 93, 49, 78, 76, 52, 56, 60, 115, 54, 79, 66, 61, 35, 75, 63, 65, 49, 70,
67, 63, 120, 89, 64, 77, 59, 63, 72, 96, 74, 65, 55, 68, 77, 92, 56, 50, 66, 101, 67, 70,
78, 86, 72, 47, 75, 58, 87, 82, 49, 82, 87, 86, 51, 102, 30, 77, 39, 62, 60, 67, 87, 73,
27, 85, 99, 25, 66, 95, 66, 51, 112, 94, 99, 64, 57, 54, 106, 63, 56, 104, 35, 59, 50,
68, 62, 51, 95, 88, 120, 56, 71, 38, 64, 89, 56, 85, 79, 52, 91, 99, 87, 96, 62, 91, 86,
48, 72, 113, 96, 65, 69, 85, 88, 64, 105, 60, 77, 77, 84, 63, 29, 87, 37, 10, 31, 59, 72,
83, 78, 48, 35, 84, 92, 105, 28, 101, 73, 57, 93, 57, 60, 70, 22, 51, 83, 71, 85, 56, 99,
27, 84, 95, 93, 107, 110, 76, 82, 58, 104, 94, 101, 96, 90, 68, 81, 75, 73, 72, 61, 34,
84, 89, 77, 49, 25, 54, 38, 78, 83, 65, 74, 64, 89, 83, 60, 85, 25, 82, 87, 82, 60, 85,
60, 89, 103, 68, 45, 79, 70, 110, 69, 83, 86, 20, 45, 72, 85, 89, 68, 97, 72, 55, 76, 92,
95, 88, 95, 81, 91, 49, 64, 90, 115, 67, 100, 80, 82, 75, 22, 42, 95, 62, 79, 83, 97, 59,
89, 87, 78, 58, 67, 35, 105, 82, 64, 36, 53, 77, 81, 80, 92, 59, 80, 92, 79, 97, 95, 41,
109, 76, 78, 45, 28, 45, 30, 69, 86, 52, 51, 66, 21, 72, 82, 63, 51, 97, 88, 55, 56, 73,
100, 65, 106, 113, 61, 91, 43, 57, 76, 68, 65, 69, 70, 78, 65, 56, 66, 64, 95, 100, 73,
71, 110, 108, 45, 75, 92, 62, 92, 59, 82, 74, 69, 45, 95, 73, 80, 75, 67, 69, 88, 64, 67,
68, 87, 65, 56, 81, 69, 74, 43, 63, 78, 93, 78, 86, 37, 52, 84, 66, 80, 40, 88, 103, 58,
87, 98, 88, 26, 48, 97, 65, 76, 86, 74, 101, 85, 83, 49, 99, 93, 91, 111, 104, 50, 84,
35, 74, 82, 49, 53, 56, 114, 116, 36, 101, 85, 83, 50, 77, 45, 78, 80, 83, 52, 85, 93,
118, 52, 94, 77, 77, 79, 103, 66, 76, 56, 88, 78, 44, 69, 92, 96, 70, 53, 102, 72, 58,
74, 108, 83, 46, 74, 66, 59, 81, 41, 61, 76, 73, 82, 50, 47, 79, 36, 67, 61, 67, 70, 80,
91, 38, 20, 78, 74, 79, 87, 77, 31, 73, 108, 37, 85, 93, 56, 56, 21, 48, 73, 77, 46, 68,
101, 70, 95, 97, 68, 65, 105, 87, 55, 51, 55, 96, 78, 63, 57, 68, 84, 36, 84, 78, 87, 51,
65, 46, 79, 29, 109, 93, 85, 54, 83, 72, 89, 88, 78, 73, 66, 65, 77, 103, 83, 68, 61, 68,
38, 56, 79, 25, 89, 49, 68, 44, 57, 89, 83, 71, 89, 25, 107, 83, 86, 64, 51, 74, 79, 63,
71, 62, 99, 98, 87, 103, 95, 77, 95, 78, 47, 83, 105, 51, 82, 98, 57, 53, 105, 73, 87,
57, 77, 91, 41, 51, 88, 42, 98, 32, 78, 103, 93, 33, 87, 98, 83, 67, 22, 64, 98, 85, 72,
59, 99, 60, 51, 73, 100, 48, 49, 88, 61, 75, 64, 81, 78, 20, 82, 54, 99, 92, 72, 67, 74,
77, 63, 91, 99, 105, 62, 87, 62, 84, 72, 75, 71, 65, 74, 75, 82, 81, 46, 112, 32, 67, 80,
97, 39, 92, 77, 85, 57, 79, 99, 49, 73, 75, 78, 75, 64, 105, 72, 66, 80, 90, 93, 49, 82,
108, 55, 60, 76, 55, 33, 86, 48, 56, 101, 46, 55, 76, 19, 36, 27, 82, 85, 41, 56, 94, 65,
73, 57, 96, 104, 46, 91, 50, 72, 44, 73, 83, 22, 60, 79, 88, 81, 100, 81, 77, 61, 98, 65,
74, 98, 48, 80, 88, 35, 75, 41, 32, 58, 14, 104, 104, 87, 56, 87, 35, 104, 51, 79, 30,
63, 93, 82, 113, 75, 56, 64, 91, 67, 42, 45, 84, 50, 25, 84, 59, 55, 53, 97, 73, 96, 85,
69, 83, 77, 67, 81, 76, 72, 42, 82, 34, 82, 61, 70, 48, 45, 67, 89, 105, 56, 70, 70, 94,
69, 63, 106, 77, 114, 89, 72, 88, 32, 76, 74, 79, 76, 98, 65, 75, 69, 82, 76, 70, 100,
14, 98, 78, 91, 76, 62, 93, 77, 89, 93, 21, 84, 79, 39, 87, 80, 66, 72, 54, 93, 85, 82,
55, 74, 42, 79, 94, 76, 83, 85, 55, 77, 87, 49, 74, 75, 47, 68, 32, 68, 48, 70, 78, 43,
57, 66, 66, 98, 101, 74, 31, 73, 67, 99, 116, 54, 90, 106, 90, 43, 71, 63, 57, 96, 34,
68, 86, 75, 46, 88, 77, 52, 77, 65, 70, 64, 65, 34, 95, 38, 71, 44, 72, 95, 70, 85, 83,
70, 78, 71, 100, 80, 43, 67, 58, 83, 76, 83, 73, 66, 48, 83, 78, 102, 87, 100, 56, 60,
107, 68, 88, 80, 99, 77, 69, 53, 99, 87, 86, 33, 71, 71, 54, 67, 42, 73, 85, 72, 100, 49,
95, 69, 85, 73, 83, 83, 56, 48, 76, 52, 88, 101, 77, 89, 83, 109, 51, 89, 70, 48, 87, 82,
75, 104, 42, 86, 98, 56, 55, 40, 75, 65, 66, 96, 56, 69, 74, 87, 94, 66, 74, 98, 92, 61,
86, 47, 86, 76, 74, 42, 53, 111, 98, 51, 56, 91, 85, 57, 67, 103, 104, 87, 70, 90, 65,
91, 89],
[88, 55, 66, 44, 17, 52, 6, 6, 69, 50, 68, 18, 49, 37, 37, 30, 64, 35, 66, 64, 47, 30, 72,
34, 33, 55, 17, 55, 17, 20, 37, 22, 51, 77, 46, 44, 72, 53, 71, 35, 43, 53, 32, 58, 50,
30, 27, 71, 42, 44, 68, 64, 60, 5, 66, 41, 54, 59, 85, 45, 57, 55, 71, 50, 53, 57, 0, 31,
56, 43, 61, 57, 48, 24, 46, 55, 65, 52, 43, 28, 64, 70, 54, 19, 53, 50, 42, 34, 48, 73,
45, 62, 33, 38, 71, 38, 33, 34, 69, 18, 90, 43, 81, 58, 60, 53, 33, 47, 93, 35, 21, 95,
54, 25, 54, 69, 8, 26, 21, 56, 63, 66, 14, 57, 64, 16, 85, 61, 70, 52, 58, 69, 25, 32, 0,
64, 49, 82, 56, 31, 64, 35, 41, 68, 29, 21, 33, 24, 58, 29, 34, 72, 48, 7, 24, 55, 51,
35, 32, 56, 15, 60, 43, 43, 36, 57, 91, 33, 83, 110, 89, 61, 48, 37, 42, 72, 85, 36, 28,
15, 92, 19, 47, 63, 27, 63, 60, 50, 98, 69, 37, 49, 35, 64, 21, 93, 36, 25, 27, 13, 10,
44, 38, 62, 16, 26, 19, 24, 30, 52, 39, 45, 47, 48, 59, 86, 36, 31, 43, 71, 95, 66, 82,
42, 37, 55, 46, 56, 31, 37, 60, 35, 95, 38, 33, 38, 60, 35, 60, 31, 17, 52, 75, 41, 50,
10, 51, 37, 34, 100, 75, 48, 35, 31, 52, 23, 48, 65, 44, 28, 25, 32, 25, 39, 29, 71, 56,
30, 5, 53, 20, 40, 38, 45, 98, 78, 25, 58, 41, 37, 23, 61, 31, 33, 42, 62, 53, 85, 15,
38, 56, 84, 67, 43, 39, 40, 28, 61, 40, 28, 41, 23, 25, 79, 11, 44, 42, 75, 92, 75, 90,
51, 34, 68, 69, 54, 99, 48, 38, 57, 69, 23, 32, 65, 64, 47, 20, 55, 14, 7, 59, 29, 77,
63, 44, 52, 55, 51, 50, 42, 55, 64, 54, 56, 25, 20, 47, 49, 10, 12, 75, 45, 28, 58, 28,
61, 38, 46, 51, 75, 25, 47, 40, 45, 53, 51, 32, 56, 53, 52, 33, 55, 64, 39, 51, 46, 77,
57, 42, 27, 42, 34, 83, 68, 36, 54, 40, 80, 32, 17, 62, 33, 22, 32, 94, 72, 23, 55, 44,
34, 46, 19, 35, 37, 71, 21, 27, 29, 9, 16, 70, 36, 85, 46, 38, 71, 67, 64, 6, 4, 84, 19,
35, 37, 70, 43, 75, 42, 40, 37, 68, 35, 27, 2, 68, 26, 43, 43, 41, 17, 54, 44, 64, 32,
42, 76, 51, 28, 24, 50, 67, 18, 48, 62, 46, 12, 37, 74, 46, 54, 61, 39, 79, 59, 44, 47,
38, 70, 73, 41, 84, 53, 59, 53, 50, 40, 29, 82, 100, 42, 46, 41, 33, 43, 89, 47, 12, 83,
35, 27, 64, 64, 99, 72, 47, 43, 74, 52, 19, 50, 25, 23, 52, 55, 15, 33, 65, 69, 65, 24,
42, 57, 63, 52, 36, 84, 36, 42, 33, 69, 55, 74, 41, 91, 11, 27, 35, 66, 37, 48, 31, 32,
42, 47, 54, 55, 43, 17, 37, 52, 59, 52, 82, 64, 41, 95, 31, 71, 52, 76, 63, 31, 37, 49,
31, 95, 13, 37, 34, 56, 69, 46, 41, 57, 49, 58, 21, 22, 33, 17, 25, 43, 25, 42, 73, 37,
15, 69, 38, 22, 63, 67, 15, 47, 33, 63, 43, 29, 79, 69, 32, 78, 22, 88, 42, 17, 27, 87,
33, 22, 37, 53, 98, 56, 22, 35, 48, 61, 21, 60, 69, 47, 20, 72, 71, 32, 59, 45, 56, 39,
42, 100, 38, 66, 21, 28, 48, 53, 46, 43, 57, 29, 21, 15, 58, 33, 58, 36, 48, 45, 49, 55,
46, 45, 38, 39, 74, 8, 88, 53, 40, 23, 81, 28, 43, 35, 63, 41, 21, 71, 47, 45, 42, 45,
56, 15, 48, 54, 40, 30, 27, 71, 38, 12, 65, 60, 44, 65, 87, 34, 72, 64, 19, 74, 65, 44,
101, 84, 93, 38, 35, 79, 64, 26, 55, 47, 63, 24, 16, 74, 29, 70, 48, 76, 47, 37, 98, 60,
41, 32, 39, 20, 39, 43, 59, 22, 55, 46, 22, 72, 40, 32, 85, 45, 79, 88, 62, 106, 16, 16,
33, 64, 33, 85, 16, 69, 41, 90, 57, 27, 38, 7, 45, 64, 56, 29, 53, 78, 75, 36, 70, 95,
36, 61, 65, 67, 23, 47, 24, 35, 51, 37, 43, 53, 39, 44, 48, 78, 38, 86, 38, 59, 50, 72,
75, 53, 31, 15, 64, 50, 50, 26, 51, 57, 14, 43, 6, 31, 48, 32, 88, 44, 46, 41, 44, 22,
55, 45, 51, 38, 44, 50, 20, 106, 22, 42, 29, 44, 58, 27, 43, 31, 27, 99, 36, 41, 81, 33,
40, 54, 48, 66, 27, 35, 38, 65, 46, 78, 41, 26, 44, 37, 35, 65, 43, 33, 71, 46, 45, 73,
52, 88, 52, 72, 50, 42, 77, 63, 54, 54, 22, 19, 46, 89, 47, 53, 21, 4, 66, 30, 14, 30,
77, 49, 57, 63, 24, 86, 52, 34, 45, 74, 32, 43, 68, 43, 55, 50, 56, 55, 86, 25, 82, 49,
76, 48, 25, 50, 35, 37, 50, 42, 49, 20, 40, 77, 53, 62, 37, 44, 37, 47, 54, 72, 37, 42,
18, 33, 20, 64, 60, 13, 52, 32, 40, 21, 43, 51, 67, 21, 33, 34, 87, 49, 49, 66, 53, 78,
47, 35, 48, 20, 71, 25, 51, 35, 47, 37, 37, 64, 72, 44, 68, 32, 19, 43, 31, 37, 11, 69,
31, 50, 72, 33, 38, 45, 16, 78, 34, 22, 64, 65, 80, 45, 55, 54, 24, 64, 51, 46, 33, 26,
54, 46, 22, 28, 59, 34, 73, 34, 44, 46, 78, 67, 9, 22, 69, 64, 29, 35, 63, 53, 17, 16,
33, 50, 30, 55, 29, 31]]], labels, args, f"evaluations/1vR_{int(time.time())}")
if __name__ == "__main__":
train()