-
Notifications
You must be signed in to change notification settings - Fork 1
/
FASLaunchControlClientInit.q
50 lines (39 loc) · 1.38 KB
/
FASLaunchControlClientInit.q
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
/ get directories
qDirectory: get `:qDirectory
dashboardDirectory: get `:dashboardDirectory
flatDir: get `:flatDir
/ select IPC host
hostPort: hsym `renxiang.cloud:5001:foorx:foorxaccess / cloud server
/ hostPort: hsym `localhost:5001:foorx:foorxaccess / local server
/ start IPC TCP/IP broadcast on port 6002 if not already enabled
\p 6002
/ upgrade HTTP protocol to websocket protocol
.z.ws:{neg[.z.w] -8! @[value;x;{`$ "'",x}]}
system"cd ",qDirectory
/ load embedpy
"Using embedPy release version 1.3.2"
\l p.q
/ load ml toolkit
"Using ML toolkit from commit 51b1995"
/ was using ML toolkit from commit 9f653e8
\l ml/ml.q
.ml.loadfile`:init.q;
"Machine Learning toolkit loaded"
"Q ML Training Client Process running on port 6001 [websocket mode]"
/ switch back to q working folder
system"cd ",dashboardDirectory
/ "Pre-importing Python ML libraries"
\l FASPythonLibraries.q
"Retrieving LSTM lookbackSteps from disk:"
show lookbackSteps: get `:lookbackSteps.dat
/ open IPC connection to server
h:hopen hostPort
if[(h>0) and hostPort = hsym `renxiang.cloud:5001; show "Connected to kdb master in cloud!"]
if[(h>0) and hostPort = hsym `localhost:5001; show "Connected to kdb master on localhost!"]
system"l FASUseModels.q"
.z.ts:{FASUseModels[]}
"Enabling immediate mode for Garbage Collection"
\g 1
"Rolling Launch Control Generator Up and Ready"
predictionFrequency:1 /in Hz
system"t ",string 1000*1%1