-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNNGlobals.py
135 lines (93 loc) · 2.93 KB
/
NNGlobals.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import colorsys
from datetime import datetime
class NNGlobals(object):
# SCREEN SIZE
SCREEN_WIDTH = 2560
SCREEN_HEIGHT = 1080 - 30
#SCREEN_HEIGHT = 1080
# SCREEN_WIDTH = 1920
# SCREEN_HEIGHT = 810
# DURATION FOR JUNCTION SCENE
DURATION_JUNCTION = 500
# GLOBAL CURRENT SCENE NUMBER
SCENE_INDEX = 0
SCENE_COUNTS = 0
#SCENE_BG_COL = (0, 0, 0)
# PREPARING GLOBAL TIMER
TIMER = None
# GLOBAL GAME SCENARIOS
CURRENT_SCENARIO = " "
# BACKGROUND COLOR
# STATEMACHINE
STATEMACHINE = None
# CONNECT THE RESULT FROM NNPixelarray OBJECT TO THIS OBJECT
START_POS_WEIGHT_V = None
START_POS_WEIGHT_W = None
START_POS_HIDDEN_A = None
START_POS_HIDDEN_RELU = None
START_POS_HIDDEN_B = None
START_POS_OUTPUT_U = None
START_POS_SOFTMAX = None
START_POS_WEIGHT_V_NEWTRAIN = None
START_POS_WEIGHT_W_NEWTRAIN = None
# FOR PIXEL ARRAYS
PIXEL_ARRAY_WEIGHT_V = None
PIXEL_ARRAY_WEIGHT_W = None
PIXEL_ARRAY_HIDDEN_A = None
PIXEL_ARRAY_HIDDEN_RELU = None
PIXEL_ARRAY_HIDDEN_B = None
PIXEL_ARRAY_OUTPUT_U = None
PIXEL_ARRAY_SOFTMAX = None
PIXEL_ARRAY_WEIGHT_V_NEWTRAIN = None
PIXEL_ARRAY_WEIGHT_W_NEWTRAIN = None
SURFACE_WEIGHT_V = None
SURFACE_WEIGHT_W = None
SURFACE_HIDDEN_A = None
SURFACE_HIDDEN_RELU = None
SURFACE_HIDDEN_B = None
SURFACE_OUTPUT_U = None
SURFACE_SOFTMAX = None
SURFACE_WEIGHT_V_NEWTRAIN = None
SURFACE_WEIGHT_W_NEWTRAIN = None
NN_NOT_INITIALIZED = True
NN_WEIGHT_V_NOT_INITIALIZED = True
NN_HIDDEN_A_NOT_INITIALIZED = True
NN_HIDDEN_RELU_NOT_INITIALIZED = True
NN_HIDDEN_B_NOT_INITIALIZED = True
NN_WEIGHT_W_NOT_INITIALIZED = True
NN_OUTPUT_U_NOT_INITIALIZED = True
NN_SOFTMAX_NOT_INITIALIZED = True
# WE DON'T NEED TO GATE BELOWS
# -> WE RE-CALCULATE BELOWS WHEN WE ENTER THE SCENE
#NN_WEIGHT_V_NEWTRAIN_NOT_INITIALIZED = True
#NN_WEIGHT_W_NEWTRAIN_NOT_INITIALIZED = True
# USER INPUT
USER_INPUT = []
USER_RESULT = 0
# TKINTER
TKINTER_QUIT = False
# DEMO MODE FLAG
DEMO_MODE_NOW = True
ALL_BUTTON_DISABLE = False
#RETURNED_FROM_DEMO = False
# DISPLAYING MOUSE COORDINATES
MOUSECOORDS = False
# GAME COUNT
GAME_COUNT = 0
# FILENAME = datetime.now().strftime("%Y_%m_%d-%I_%M_%S_%p")
# FILE = open("GAME_RECORD/" + FILENAME + ".txt", "w")
# G_COUNT_LINE = ["GAME_COUNT : " + str(GAME_COUNT)]
#
# FILE.writelines(G_COUNT_LINE)
# FILE.write("\n")
#
# FILE.close() # to change file access modes
#
#
def __init__(self):
#self.SCENE_BG_COL = self.hsv2rgb(self.SCENE_INDEX / self.SCENE_COUNTS, 0.2, 0.8)
pass
# < COLOR CONVERSION >
# https://stackoverflow.com/questions/24852345/hsv-to-rgb-color-conversion
def hsv2rgb(self, h,s,v):
return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h,s,v))